summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.cmake.conf3
-rw-r--r--.qmake.conf8
-rw-r--r--CHROMIUM_VERSION3
-rw-r--r--CMakeLists.txt267
-rw-r--r--cmake/FindGn.cmake10
-rw-r--r--cmake/Functions.cmake751
-rw-r--r--cmake/Gn.cmake69
-rw-r--r--conanfile.py78
-rw-r--r--configure.cmake141
-rw-r--r--configure.pri558
-rw-r--r--dependencies.yaml11
-rw-r--r--examples/CMakeLists.txt42
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/pdf/CMakeLists.txt5
-rw-r--r--examples/pdf/multipage/CMakeLists.txt62
-rw-r--r--examples/pdf/multipage/viewer.qml46
-rw-r--r--examples/pdf/pdfviewer/CMakeLists.txt62
-rw-r--r--examples/pdf/pdfviewer/viewer.qml48
-rw-r--r--examples/pdfwidgets/CMakeLists.txt1
-rw-r--r--examples/pdfwidgets/pdfviewer/CMakeLists.txt63
-rw-r--r--examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc6
-rw-r--r--examples/webenginequick/CMakeLists.txt (renamed from examples/webengine/CMakeLists.txt)0
-rw-r--r--examples/webenginequick/customdialogs/CMakeLists.txt (renamed from examples/webengine/customdialogs/CMakeLists.txt)4
-rw-r--r--examples/webenginequick/customdialogs/MessageRectangle.qml (renamed from examples/webengine/customdialogs/MessageRectangle.qml)0
-rw-r--r--examples/webenginequick/customdialogs/SwitchButton.qml (renamed from examples/webengine/customdialogs/SwitchButton.qml)0
-rw-r--r--examples/webenginequick/customdialogs/WebView.qml (renamed from examples/webengine/customdialogs/WebView.qml)8
-rw-r--r--examples/webenginequick/customdialogs/customdialogs.pro (renamed from examples/webengine/customdialogs/customdialogs.pro)2
-rw-r--r--examples/webenginequick/customdialogs/customdialogs.qrc (renamed from examples/webengine/customdialogs/customdialogs.qrc)0
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-auth1.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs-auth1.png)bin18549 -> 18549 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-auth2.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs-auth2.png)bin5064 -> 5064 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-color1.pngbin0 -> 9729 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-color2.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs-color2.png)bin3952 -> 3952 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-file1.pngbin0 -> 18540 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-file2.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs-file2.png)bin6773 -> 6773 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-menu.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs-menu.png)bin5484 -> 5484 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-prompt1.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs-prompt1.png)bin14845 -> 14845 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-prompt2.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs-prompt2.png)bin4764 -> 4764 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs-tooltip.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs-tooltip.png)bin1617 -> 1617 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/images/customdialogs.png (renamed from examples/webengine/customdialogs/doc/images/customdialogs.png)bin9093 -> 9093 bytes
-rw-r--r--examples/webenginequick/customdialogs/doc/src/customdialogs.qdoc (renamed from examples/webengine/customdialogs/doc/src/customdialogs.qdoc)42
-rw-r--r--examples/webenginequick/customdialogs/forms/Authentication.qml (renamed from examples/webengine/customdialogs/forms/Authentication.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/AuthenticationForm.ui.qml (renamed from examples/webengine/customdialogs/forms/AuthenticationForm.ui.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/ColorCell.qml (renamed from examples/webengine/customdialogs/forms/ColorCell.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/ColorPicker.qml (renamed from examples/webengine/customdialogs/forms/ColorPicker.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/ColorPickerForm.ui.qml (renamed from examples/webengine/customdialogs/forms/ColorPickerForm.ui.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/CustomButton.qml (renamed from examples/webengine/customdialogs/forms/CustomButton.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/FilePicker.qml (renamed from examples/webengine/customdialogs/forms/FilePicker.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/FilePickerForm.ui.qml (renamed from examples/webengine/customdialogs/forms/FilePickerForm.ui.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/FileRow.qml (renamed from examples/webengine/customdialogs/forms/FileRow.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/JavaScript.qml (renamed from examples/webengine/customdialogs/forms/JavaScript.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml (renamed from examples/webengine/customdialogs/forms/JavaScriptForm.ui.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/Menu.qml (renamed from examples/webengine/customdialogs/forms/Menu.qml)0
-rw-r--r--examples/webenginequick/customdialogs/forms/MenuForm.ui.qml (renamed from examples/webengine/customdialogs/forms/MenuForm.ui.qml)0
-rw-r--r--examples/webenginequick/customdialogs/icon.svg (renamed from examples/webengine/customdialogs/icon.svg)0
-rw-r--r--examples/webenginequick/customdialogs/index.html (renamed from examples/webengine/customdialogs/index.html)2
-rw-r--r--examples/webenginequick/customdialogs/main.cpp (renamed from examples/webengine/customdialogs/main.cpp)10
-rw-r--r--examples/webenginequick/customdialogs/main.qml (renamed from examples/webengine/customdialogs/main.qml)6
-rw-r--r--examples/webenginequick/customdialogs/server.cpp (renamed from examples/webengine/customdialogs/server.cpp)19
-rw-r--r--examples/webenginequick/customdialogs/server.h (renamed from examples/webengine/customdialogs/server.h)1
-rw-r--r--examples/webenginequick/customdialogs/style.css (renamed from examples/webengine/customdialogs/style.css)0
-rw-r--r--examples/webenginequick/lifecycle/CMakeLists.txt (renamed from examples/webengine/lifecycle/CMakeLists.txt)2
-rw-r--r--examples/webenginequick/lifecycle/WebBrowser.qml (renamed from examples/webengine/lifecycle/WebBrowser.qml)0
-rw-r--r--examples/webenginequick/lifecycle/WebTab.qml (renamed from examples/webengine/lifecycle/WebTab.qml)0
-rw-r--r--examples/webenginequick/lifecycle/WebTabBar.qml (renamed from examples/webengine/lifecycle/WebTabBar.qml)0
-rw-r--r--examples/webenginequick/lifecycle/WebTabButton.qml (renamed from examples/webengine/lifecycle/WebTabButton.qml)0
-rw-r--r--examples/webenginequick/lifecycle/WebTabStack.qml (renamed from examples/webengine/lifecycle/WebTabStack.qml)0
-rw-r--r--examples/webenginequick/lifecycle/WebToolButton.qml (renamed from examples/webengine/lifecycle/WebToolButton.qml)0
-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.qdoc (renamed from examples/webengine/lifecycle/doc/src/lifecycle.qdoc)2
-rw-r--r--examples/webenginequick/lifecycle/lifecycle.pro (renamed from examples/webengine/lifecycle/lifecycle.pro)2
-rw-r--r--examples/webenginequick/lifecycle/main.cpp (renamed from examples/webengine/lifecycle/main.cpp)0
-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/minimal/CMakeLists.txt (renamed from examples/webengine/minimal/CMakeLists.txt)12
-rw-r--r--examples/webenginequick/minimal/doc/src/minimal.qdoc (renamed from examples/webengine/minimal/doc/src/minimal.qdoc)6
-rw-r--r--examples/webenginequick/minimal/main.cpp (renamed from examples/webengine/minimal/main.cpp)0
-rw-r--r--examples/webenginequick/minimal/main.qml (renamed from examples/webengine/minimal/main.qml)0
-rw-r--r--examples/webenginequick/minimal/minimal.pro (renamed from examples/webengine/minimal/minimal.pro)2
-rw-r--r--examples/webenginequick/minimal/qml.qrc (renamed from examples/webengine/minimal/qml.qrc)0
-rw-r--r--examples/webenginequick/quicknanobrowser/ApplicationRoot.qml (renamed from examples/webengine/quicknanobrowser/ApplicationRoot.qml)0
-rw-r--r--examples/webenginequick/quicknanobrowser/BrowserDialog.qml (renamed from examples/webengine/quicknanobrowser/BrowserDialog.qml)0
-rw-r--r--examples/webenginequick/quicknanobrowser/BrowserWindow.qml (renamed from examples/webengine/quicknanobrowser/BrowserWindow.qml)18
-rw-r--r--examples/webenginequick/quicknanobrowser/CMakeLists.txt (renamed from examples/webengine/quicknanobrowser/CMakeLists.txt)2
-rw-r--r--examples/webenginequick/quicknanobrowser/DownloadView.qml (renamed from examples/webengine/quicknanobrowser/DownloadView.qml)0
-rw-r--r--examples/webenginequick/quicknanobrowser/FindBar.qml (renamed from examples/webengine/quicknanobrowser/FindBar.qml)0
-rw-r--r--examples/webenginequick/quicknanobrowser/FullScreenNotification.qml (renamed from examples/webengine/quicknanobrowser/FullScreenNotification.qml)0
-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.qdoc (renamed from examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc)38
-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.json (renamed from examples/webengine/quicknanobrowser/icons/3rdparty/qt_attribution.json)2
-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.cpp (renamed from examples/webengine/quicknanobrowser/main.cpp)8
-rw-r--r--examples/webenginequick/quicknanobrowser/quicknanobrowser.pro (renamed from examples/webengine/quicknanobrowser/quicknanobrowser.pro)2
-rw-r--r--examples/webenginequick/quicknanobrowser/resources.qrc (renamed from examples/webengine/quicknanobrowser/resources.qrc)0
-rw-r--r--examples/webenginequick/quicknanobrowser/utils.h (renamed from examples/webengine/quicknanobrowser/utils.h)0
-rw-r--r--examples/webenginequick/recipebrowser/CMakeLists.txt (renamed from examples/webengine/recipebrowser/CMakeLists.txt)2
-rw-r--r--examples/webenginequick/recipebrowser/doc/images/recipebrowser-demo.jpg (renamed from examples/webengine/recipebrowser/doc/images/recipebrowser-demo.jpg)bin33398 -> 33398 bytes
-rw-r--r--examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc (renamed from examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc)14
-rw-r--r--examples/webenginequick/recipebrowser/main.cpp (renamed from examples/webengine/recipebrowser/main.cpp)0
-rw-r--r--examples/webenginequick/recipebrowser/recipebrowser.pro (renamed from examples/webengine/recipebrowser/recipebrowser.pro)2
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/markdown.css (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/markdown.css)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/marked.js (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.js)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json (renamed from examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/assets/custom.css (renamed from examples/webengine/recipebrowser/resources/pages/assets/custom.css)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/assets/custom.js (renamed from examples/webengine/recipebrowser/resources/pages/assets/custom.js)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/burger.html (renamed from examples/webengine/recipebrowser/resources/pages/burger.html)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/cupcakes.html (renamed from examples/webengine/recipebrowser/resources/pages/cupcakes.html)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/images/burger.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/burger.jpg)bin48882 -> 48882 bytes
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/images/cupcakes.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/cupcakes.jpg)bin38653 -> 38653 bytes
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/images/pasta.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/pasta.jpg)bin42411 -> 42411 bytes
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/images/pizza.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/pizza.jpg)bin49068 -> 49068 bytes
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/images/skewers.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/skewers.jpg)bin49246 -> 49246 bytes
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/images/soup.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/soup.jpg)bin49028 -> 49028 bytes
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/images/steak.jpg (renamed from examples/webengine/recipebrowser/resources/pages/images/steak.jpg)bin49202 -> 49202 bytes
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/pasta.html (renamed from examples/webengine/recipebrowser/resources/pages/pasta.html)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/pizza.html (renamed from examples/webengine/recipebrowser/resources/pages/pizza.html)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/skewers.html (renamed from examples/webengine/recipebrowser/resources/pages/skewers.html)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/soup.html (renamed from examples/webengine/recipebrowser/resources/pages/soup.html)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/steak.html (renamed from examples/webengine/recipebrowser/resources/pages/steak.html)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/qml/RecipeList.qml (renamed from examples/webengine/recipebrowser/resources/qml/RecipeList.qml)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/qml/main.qml (renamed from examples/webengine/recipebrowser/resources/qml/main.qml)0
-rw-r--r--examples/webenginequick/recipebrowser/resources/resources.qrc (renamed from examples/webengine/recipebrowser/resources/resources.qrc)0
-rw-r--r--examples/webenginequick/webengineaction/CMakeLists.txt (renamed from examples/webengine/webengineaction/CMakeLists.txt)2
-rw-r--r--examples/webenginequick/webengineaction/doc/images/webengineaction-example.png (renamed from examples/webengine/webengineaction/doc/images/webengineaction-example.png)bin100266 -> 100266 bytes
-rw-r--r--examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc (renamed from examples/webengine/webengineaction/doc/src/webengineaction.qdoc)6
-rw-r--r--examples/webenginequick/webengineaction/main.cpp (renamed from examples/webengine/webengineaction/main.cpp)0
-rw-r--r--examples/webenginequick/webengineaction/main.qml (renamed from examples/webengine/webengineaction/main.qml)0
-rw-r--r--examples/webenginequick/webengineaction/qml.qrc (renamed from examples/webengine/webengineaction/qml.qrc)0
-rw-r--r--examples/webenginequick/webengineaction/webengineaction.pro (renamed from examples/webengine/webengineaction/webengineaction.pro)2
-rw-r--r--examples/webenginequick/webenginequick.pro (renamed from examples/webengine/webengine.pro)0
-rw-r--r--examples/webenginewidgets/CMakeLists.txt3
-rw-r--r--examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json2
-rw-r--r--examples/webenginewidgets/maps/doc/src/maps.qdoc8
-rw-r--r--examples/webenginewidgets/markdowneditor/mainwindow.cpp33
-rw-r--r--examples/webenginewidgets/markdowneditor/mainwindow.h4
-rw-r--r--examples/webenginewidgets/markdowneditor/previewpage.h4
-rw-r--r--examples/webenginewidgets/printme/doc/src/printme.qdoc21
-rw-r--r--examples/webenginewidgets/printme/printhandler.cpp29
-rw-r--r--examples/webenginewidgets/printme/printhandler.h5
-rw-r--r--examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json2
-rw-r--r--examples/webenginewidgets/simplebrowser/webview.cpp23
-rw-r--r--examples/webenginewidgets/spellchecker/CMakeLists.txt10
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json2
-rw-r--r--mkspecs/features/default_pre.prf20
-rw-r--r--mkspecs/features/functions.prf138
-rw-r--r--mkspecs/features/gn_generator.prf268
-rw-r--r--qt_cmdline.cmake4
m---------src/3rdparty0
-rw-r--r--src/CMakeLists.txt192
-rw-r--r--src/buildtools/buildtools.pro20
-rw-r--r--src/buildtools/config/common.pri113
-rw-r--r--src/buildtools/config/functions.pri8
-rw-r--r--src/buildtools/config/linking.pri77
-rw-r--r--src/buildtools/config/linux.pri178
-rw-r--r--src/buildtools/config/mac_osx.pri38
-rw-r--r--src/buildtools/config/support.pri257
-rw-r--r--src/buildtools/config/windows.pri91
-rw-r--r--src/buildtools/configure.json843
-rw-r--r--src/buildtools/configure_host.pro65
-rw-r--r--src/buildtools/configure_target.pro33
-rw-r--r--src/buildtools/gn.pro39
-rw-r--r--src/buildtools/ninja.pro23
-rw-r--r--src/core/CMakeLists.txt296
-rw-r--r--src/core/api/CMakeLists.txt104
-rw-r--r--src/core/api/configure.cmake37
-rw-r--r--src/core/api/core_api.pro119
-rw-r--r--src/core/api/qt_cmdline.cmake31
-rw-r--r--src/core/api/qtwebenginecoreglobal.h1
-rw-r--r--src/core/api/qwebenginecallback_p.h253
-rw-r--r--src/core/api/qwebenginecertificateerror.h5
-rw-r--r--src/core/api/qwebengineclientcertificateselection.h3
-rw-r--r--src/core/api/qwebengineclientcertificatestore.h3
-rw-r--r--src/core/api/qwebenginecontextmenurequest.cpp6
-rw-r--r--src/core/api/qwebenginecontextmenurequest.h4
-rw-r--r--src/core/api/qwebenginecookiestore.cpp54
-rw-r--r--src/core/api/qwebenginecookiestore.h3
-rw-r--r--src/core/api/qwebenginecookiestore_p.h15
-rw-r--r--src/core/api/qwebenginedownloadrequest_p.h4
-rw-r--r--src/core/api/qwebenginefindtextresult.h3
-rw-r--r--src/core/api/qwebenginehistory.h4
-rw-r--r--src/core/api/qwebenginehttprequest.h3
-rw-r--r--src/core/api/qwebengineloadinginfo.h6
-rw-r--r--src/core/api/qwebenginemessagepumpscheduler_p.h3
-rw-r--r--src/core/api/qwebenginenavigationrequest.h3
-rw-r--r--src/core/api/qwebenginenewwindowrequest.cpp28
-rw-r--r--src/core/api/qwebenginenotification.h3
-rw-r--r--src/core/api/qwebenginepage.cpp135
-rw-r--r--src/core/api/qwebenginepage.h33
-rw-r--r--src/core/api/qwebenginepage_p.h27
-rw-r--r--src/core/api/qwebengineprofile.h5
-rw-r--r--src/core/api/qwebengineprofile_p.h4
-rw-r--r--src/core/api/qwebenginequotarequest.h3
-rw-r--r--src/core/api/qwebengineregisterprotocolhandlerrequest.h3
-rw-r--r--src/core/api/qwebenginescript.h5
-rw-r--r--src/core/api/qwebenginescriptcollection.h3
-rw-r--r--src/core/api/qwebenginescriptcollection_p.h3
-rw-r--r--src/core/api/qwebenginesettings.h5
-rw-r--r--src/core/api/qwebengineurlrequestinfo.h3
-rw-r--r--src/core/api/qwebengineurlrequestinfo_p.h3
-rw-r--r--src/core/api/qwebengineurlrequestinterceptor.h3
-rw-r--r--src/core/api/qwebengineurlrequestjob.h3
-rw-r--r--src/core/api/qwebengineurlscheme.h3
-rw-r--r--src/core/api/qwebengineurlschemehandler.h3
-rw-r--r--src/core/certificate_error_controller.cpp6
-rw-r--r--src/core/clipboard_qt.cpp2
-rw-r--r--src/core/compositor/compositor_resource_fence.cpp1
-rw-r--r--src/core/compositor/display_overrides.cpp4
-rw-r--r--src/core/compositor/display_software_output_surface.cpp9
-rw-r--r--src/core/config/common.pri48
-rw-r--r--src/core/config/linux.pri44
-rw-r--r--src/core/config/mac_osx.pri8
-rw-r--r--src/core/config/windows.pri8
-rw-r--r--src/core/configure/BUILD.root.gn.in9
-rw-r--r--src/core/content_browser_client_qt.cpp8
-rw-r--r--src/core/core.pro48
-rw-r--r--src/core/core_chromium.pri352
-rw-r--r--src/core/core_common.pri21
-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.pro120
-rw-r--r--src/core/core_project.pro28
-rw-r--r--src/core/devtools_frontend_qt.cpp4
-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.tmpl (renamed from tools/about_credits_entry.tmpl)0
-rw-r--r--src/core/doc/qtwebengine.qdocconf4
-rw-r--r--src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc5
-rw-r--r--src/core/doc/src/external-resources.qdoc (renamed from src/webenginequick/doc/src/external-resources.qdoc)16
-rw-r--r--src/core/doc/src/qt6-changes.qdoc148
-rw-r--r--src/core/doc/src/qtwebengine-debugging.qdoc (renamed from src/webenginequick/doc/src/qtwebengine-debugging.qdoc)0
-rw-r--r--src/core/doc/src/qtwebengine-deploying.qdoc (renamed from src/webenginequick/doc/src/qtwebengine-deploying.qdoc)0
-rw-r--r--src/core/doc/src/qtwebengine-features.qdoc (renamed from src/webenginequick/doc/src/qtwebengine-features.qdoc)48
-rw-r--r--src/core/doc/src/qtwebengine-index.qdoc (renamed from src/webenginequick/doc/src/qtwebengine-index.qdoc)8
-rw-r--r--src/core/doc/src/qtwebengine-modules.qdoc (renamed from src/webenginequick/doc/src/qtwebengine-modules.qdoc)0
-rw-r--r--src/core/doc/src/qtwebengine-overview.qdoc (renamed from src/webenginequick/doc/src/qtwebengine-overview.qdoc)8
-rw-r--r--src/core/doc/src/qtwebengine-platform-notes.qdoc (renamed from src/webenginequick/doc/src/qtwebengine-platform-notes.qdoc)4
-rw-r--r--src/core/doc/src/qtwebenginecore-index.qdoc5
-rw-r--r--src/core/doc/src/qtwebenginecore-module.qdoc12
-rw-r--r--src/core/doc/src/qwebengine-licensing.qdoc (renamed from src/webenginequick/doc/src/qwebengine-licensing.qdoc)0
-rw-r--r--src/core/doc/src/qwebenginesettings_lgpl.qdoc13
-rw-r--r--src/core/download_manager_delegate_qt.cpp8
-rw-r--r--src/core/favicon_service_factory_qt.cpp3
-rw-r--r--src/core/file_picker_controller.cpp4
-rw-r--r--src/core/file_picker_controller.h3
-rw-r--r--src/core/find_text_helper.h6
-rw-r--r--src/core/gn_run.pro68
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp1
-rw-r--r--src/core/native_web_keyboard_event_qt.cpp5
-rw-r--r--src/core/net/client_cert_override.cpp13
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp43
-rw-r--r--src/core/net/cookie_monster_delegate_qt.h13
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.cpp41
-rw-r--r--src/core/net/url_request_custom_job_proxy.cpp2
-rw-r--r--src/core/ozone/BUILD.gn16
-rw-r--r--src/core/ozone/gl_context_qt.cpp5
-rw-r--r--src/core/ozone/ozone_platform_qt.cpp12
-rw-r--r--src/core/printing/print_view_manager_base_qt.cpp5
-rw-r--r--src/core/render_widget_host_view_qt_delegate_client.cpp25
-rw-r--r--src/core/render_widget_host_view_qt_delegate_client.h1
-rw-r--r--src/core/renderer/web_channel_ipc_transport.cpp39
-rw-r--r--src/core/renderer/web_channel_ipc_transport.h2
-rw-r--r--src/core/tools/CMakeLists.txt2
-rw-r--r--src/core/web_contents_adapter.cpp21
-rw-r--r--src/core/web_engine_context.cpp27
-rw-r--r--src/core/web_event_factory.cpp6
-rw-r--r--src/host/CMakeLists.txt9
-rw-r--r--src/pdf/CMakeLists.txt172
-rw-r--r--src/pdf/config/common.pri78
-rw-r--r--src/pdf/config/ios.pri66
-rw-r--r--src/pdf/configure.cmake39
-rw-r--r--src/pdf/configure.json64
-rw-r--r--src/pdf/configure/BUILD.root.gn.in36
-rw-r--r--src/pdf/doc/qtpdf.qdocconf4
-rw-r--r--src/pdf/gn_run.pro69
-rw-r--r--src/pdf/jsbridge.cpp38
-rw-r--r--src/pdf/pdf.pro31
-rw-r--r--src/pdf/pdfcore.pro87
-rw-r--r--src/pdf/pdfcore_generator.pro15
-rw-r--r--src/pdf/pdfcore_prl_generator.pro27
-rw-r--r--src/pdf/plugins/imageformats/pdf/CMakeLists.txt10
-rw-r--r--src/pdf/plugins/imageformats/pdf/main.cpp (renamed from src/plugins/imageformats/pdf/main.cpp)0
-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.cpp (renamed from src/plugins/imageformats/pdf/qpdfiohandler.cpp)0
-rw-r--r--src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h (renamed from src/plugins/imageformats/pdf/qpdfiohandler_p.h)0
-rw-r--r--src/pdf/qpdfbookmarkmodel.cpp1
-rw-r--r--src/pdf/qpdfbookmarkmodel.h (renamed from src/pdf/api/qpdfbookmarkmodel.h)0
-rw-r--r--src/pdf/qpdfdestination.h (renamed from src/pdf/api/qpdfdestination.h)0
-rw-r--r--src/pdf/qpdfdestination_p.h (renamed from src/pdf/api/qpdfdestination_p.h)0
-rw-r--r--src/pdf/qpdfdocument.h (renamed from src/pdf/api/qpdfdocument.h)0
-rw-r--r--src/pdf/qpdfdocument_p.h (renamed from src/pdf/api/qpdfdocument_p.h)0
-rw-r--r--src/pdf/qpdfdocumentrenderoptions.h (renamed from src/pdf/api/qpdfdocumentrenderoptions.h)0
-rw-r--r--src/pdf/qpdflinkmodel_p.h (renamed from src/pdf/api/qpdflinkmodel_p.h)0
-rw-r--r--src/pdf/qpdflinkmodel_p_p.h (renamed from src/pdf/api/qpdflinkmodel_p_p.h)0
-rw-r--r--src/pdf/qpdfnamespace.h (renamed from src/pdf/api/qpdfnamespace.h)0
-rw-r--r--src/pdf/qpdfpagenavigation.h (renamed from src/pdf/api/qpdfpagenavigation.h)0
-rw-r--r--src/pdf/qpdfpagerenderer.h (renamed from src/pdf/api/qpdfpagerenderer.h)0
-rw-r--r--src/pdf/qpdfsearchmodel.h (renamed from src/pdf/api/qpdfsearchmodel.h)0
-rw-r--r--src/pdf/qpdfsearchmodel_p.h (renamed from src/pdf/api/qpdfsearchmodel_p.h)0
-rw-r--r--src/pdf/qpdfsearchresult.h (renamed from src/pdf/api/qpdfsearchresult.h)0
-rw-r--r--src/pdf/qpdfsearchresult_p.h (renamed from src/pdf/api/qpdfsearchresult_p.h)0
-rw-r--r--src/pdf/qpdfselection.h (renamed from src/pdf/api/qpdfselection.h)0
-rw-r--r--src/pdf/qpdfselection_p.h (renamed from src/pdf/api/qpdfselection_p.h)11
-rw-r--r--src/pdf/qtpdf.gni7
-rw-r--r--src/pdf/qtpdfglobal.h (renamed from src/pdf/api/qtpdfglobal.h)0
-rw-r--r--src/pdf/quick/qmldir4
-rw-r--r--src/pdf/quick/quick.pro40
-rw-r--r--src/pdf/quick/resources.qrc10
-rw-r--r--src/pdfquick/CMakeLists.txt50
-rw-r--r--src/pdfquick/plugin.cpp (renamed from src/pdf/quick/plugin.cpp)8
-rw-r--r--src/pdfquick/plugins.qmltypes (renamed from src/pdf/quick/plugins.qmltypes)0
-rw-r--r--src/pdfquick/qml/+material/PdfStyle.qml (renamed from src/pdf/quick/qml/+material/PdfStyle.qml)0
-rw-r--r--src/pdfquick/qml/+universal/PdfStyle.qml (renamed from src/pdf/quick/qml/+universal/PdfStyle.qml)0
-rw-r--r--src/pdfquick/qml/PdfMultiPageView.qml (renamed from src/pdf/quick/qml/PdfMultiPageView.qml)0
-rw-r--r--src/pdfquick/qml/PdfPageView.qml (renamed from src/pdf/quick/qml/PdfPageView.qml)0
-rw-r--r--src/pdfquick/qml/PdfScrollablePageView.qml (renamed from src/pdf/quick/qml/PdfScrollablePageView.qml)0
-rw-r--r--src/pdfquick/qml/PdfStyle.qml (renamed from src/pdf/quick/qml/PdfStyle.qml)0
-rw-r--r--src/pdfquick/qquickpdfdocument.cpp (renamed from src/pdf/quick/qquickpdfdocument.cpp)0
-rw-r--r--src/pdfquick/qquickpdfdocument_p.h (renamed from src/pdf/quick/qquickpdfdocument_p.h)3
-rw-r--r--src/pdfquick/qquickpdflinkmodel.cpp (renamed from src/pdf/quick/qquickpdflinkmodel.cpp)0
-rw-r--r--src/pdfquick/qquickpdflinkmodel_p.h (renamed from src/pdf/quick/qquickpdflinkmodel_p.h)7
-rw-r--r--src/pdfquick/qquickpdfnavigationstack.cpp (renamed from src/pdf/quick/qquickpdfnavigationstack.cpp)4
-rw-r--r--src/pdfquick/qquickpdfnavigationstack_p.h (renamed from src/pdf/quick/qquickpdfnavigationstack_p.h)7
-rw-r--r--src/pdfquick/qquickpdfsearchmodel.cpp (renamed from src/pdf/quick/qquickpdfsearchmodel.cpp)0
-rw-r--r--src/pdfquick/qquickpdfsearchmodel_p.h (renamed from src/pdf/quick/qquickpdfsearchmodel_p.h)7
-rw-r--r--src/pdfquick/qquickpdfselection.cpp (renamed from src/pdf/quick/qquickpdfselection.cpp)4
-rw-r--r--src/pdfquick/qquickpdfselection_p.h (renamed from src/pdf/quick/qquickpdfselection_p.h)6
-rw-r--r--src/pdfquick/qquicktableviewextra.cpp (renamed from src/pdf/quick/qquicktableviewextra.cpp)0
-rw-r--r--src/pdfquick/qquicktableviewextra_p.h (renamed from src/pdf/quick/qquicktableviewextra_p.h)5
-rw-r--r--src/pdfquick/qtpdfquickglobal_p.h (renamed from src/core/api/qwebenginecallback.h)79
-rw-r--r--src/pdfwidgets/CMakeLists.txt14
-rw-r--r--src/pdfwidgets/configure.json28
-rw-r--r--src/pdfwidgets/pdfwidgets.pro13
-rw-r--r--src/pdfwidgets/qpdfview_p.h2
-rw-r--r--src/plugins/imageformats/imageformats.pro2
-rw-r--r--src/plugins/imageformats/pdf/pdf.pro13
-rw-r--r--src/plugins/plugins.pro3
-rw-r--r--src/plugins/qwebengineview/qwebengineview.pro11
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.qrc5
-rw-r--r--src/process/CMakeLists.txt55
-rw-r--r--src/process/Info_mac.plist22
-rw-r--r--src/process/main.cpp8
-rw-r--r--src/process/process.pro78
-rw-r--r--src/src.pro65
-rw-r--r--src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro55
-rw-r--r--src/webenginequick/CMakeLists.txt13
-rw-r--r--src/webenginequick/api/qquickwebengineaction_p.h2
-rw-r--r--src/webenginequick/api/qquickwebenginenewwindowrequest.cpp (renamed from src/webenginequick/api/qquickwebenginenewviewrequest.cpp)14
-rw-r--r--src/webenginequick/api/qquickwebenginenewwindowrequest_p.h (renamed from src/webenginequick/api/qquickwebenginenewviewrequest_p.h)6
-rw-r--r--src/webenginequick/api/qquickwebengineprofile.cpp2
-rw-r--r--src/webenginequick/api/qquickwebenginescriptcollection.cpp2
-rw-r--r--src/webenginequick/api/qquickwebenginescriptcollection_p.h (renamed from src/webenginequick/api/qquickwebenginescriptcollection.h)15
-rw-r--r--src/webenginequick/api/qquickwebengineview.cpp66
-rw-r--r--src/webenginequick/api/qquickwebengineview_p.h41
-rw-r--r--src/webenginequick/api/qquickwebengineview_p_p.h2
-rw-r--r--src/webenginequick/configure.json34
-rw-r--r--src/webenginequick/doc/snippets/qtwebengine_build_snippet.qdoc9
-rw-r--r--src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml10
-rw-r--r--src/webenginequick/doc/src/navigation_history.qdoc2
-rw-r--r--src/webenginequick/doc/src/qtwebengine-examples.qdoc2
-rw-r--r--src/webenginequick/doc/src/qtwebengine-module.qdoc12
-rw-r--r--src/webenginequick/doc/src/qtwebengine-qmlmodule.qdoc19
-rw-r--r--src/webenginequick/doc/src/webengine_certificate_error.qdoc11
-rw-r--r--src/webenginequick/doc/src/webengineview_lgpl.qdoc28
-rw-r--r--src/webenginequick/module.pro78
-rw-r--r--src/webenginequick/render_widget_host_view_qt_delegate_quick.cpp13
-rw-r--r--src/webenginequick/ui/CMakeLists.txt4
-rw-r--r--src/webenginequick/ui/ColorDialog.qml286
-rw-r--r--src/webenginequick/ui/FilePicker.qml16
-rw-r--r--src/webenginequick/ui/ui.pro20
-rw-r--r--src/webenginequick/ui_delegates_manager.h2
-rw-r--r--src/webenginequick/webenginequick.pro12
-rw-r--r--src/webenginewidgets/CMakeLists.txt12
-rw-r--r--src/webenginewidgets/api/qwebenginenotificationpresenter_p.h3
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp82
-rw-r--r--src/webenginewidgets/api/qwebengineview.h44
-rw-r--r--src/webenginewidgets/api/qwebengineview_p.h9
-rw-r--r--src/webenginewidgets/configure.json28
-rw-r--r--src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc5
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc5
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc9
-rw-r--r--src/webenginewidgets/plugins/qwebengineview/CMakeLists.txt22
-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.cpp (renamed from src/plugins/qwebengineview/qwebengineview_plugin.cpp)0
-rw-r--r--src/webenginewidgets/plugins/qwebengineview/qwebengineview_plugin.h (renamed from src/plugins/qwebengineview/qwebengineview_plugin.h)0
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp9
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h1
-rw-r--r--src/webenginewidgets/webenginewidgets.pro26
-rw-r--r--sync.profile4
-rw-r--r--tests/CMakeLists.txt28
-rw-r--r--tests/auto/CMakeLists.txt17
-rw-r--r--tests/auto/Info.plist.in18
-rw-r--r--tests/auto/auto.pro26
-rw-r--r--tests/auto/cmake/CMakeLists.txt2
-rw-r--r--tests/auto/cmake/cmake.pro8
-rw-r--r--tests/auto/core/certificateerror/BLACKLIST2
-rw-r--r--tests/auto/core/certificateerror/certificateerror.pro3
-rw-r--r--tests/auto/core/certificateerror/tst_certificateerror.cpp23
-rw-r--r--tests/auto/core/core.pro12
-rw-r--r--tests/auto/core/devtools/devtools.pro1
-rw-r--r--tests/auto/core/origins/origins.pro8
-rw-r--r--tests/auto/core/origins/tst_origins.cpp6
-rw-r--r--tests/auto/core/origins/tst_origins.qrc23
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/qwebengineclientcertificatestore.pro1
-rw-r--r--tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.qrc8
-rw-r--r--tests/auto/core/qwebenginecookiestore/qwebenginecookiestore.pro2
-rw-r--r--tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.cpp1
-rw-r--r--tests/auto/core/qwebenginecookiestore/tst_qwebenginecookiestore.qrc6
-rw-r--r--tests/auto/core/qwebenginesettings/qwebenginesettings.pro2
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/qwebengineurlrequestinterceptor.pro2
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.qrc24
-rw-r--r--tests/auto/core/tests.pri17
-rw-r--r--tests/auto/embed_info_plist.pri13
-rw-r--r--tests/auto/httpserver/httpserver.cmake7
-rw-r--r--tests/auto/pdf/CMakeLists.txt6
-rw-r--r--tests/auto/pdf/pdf.pro8
-rw-r--r--tests/auto/pdf/qpdfbookmarkmodel/CMakeLists.txt9
-rw-r--r--tests/auto/pdf/qpdfbookmarkmodel/qpdfbookmarkmodel.pro5
-rw-r--r--tests/auto/pdf/qpdfdocument/CMakeLists.txt9
-rw-r--r--tests/auto/pdf/qpdfdocument/qpdfdocument.pro6
-rw-r--r--tests/auto/pdf/qpdfpagenavigation/CMakeLists.txt8
-rw-r--r--tests/auto/pdf/qpdfpagenavigation/qpdfpagenavigation.pro5
-rw-r--r--tests/auto/pdf/qpdfpagerenderer/CMakeLists.txt9
-rw-r--r--tests/auto/pdf/qpdfpagerenderer/qpdfpagerenderer.pro5
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/CMakeLists.txt8
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/qpdfsearchmodel.pro5
-rw-r--r--tests/auto/quick/dialogs/WebView.qml10
-rw-r--r--tests/auto/quick/dialogs/dialogs.pro13
-rw-r--r--tests/auto/quick/dialogs/dialogs.qrc6
-rw-r--r--tests/auto/quick/inspectorserver/inspectorserver.pro4
-rw-r--r--tests/auto/quick/inspectorserver/tst_inspectorserver.cpp4
-rw-r--r--tests/auto/quick/publicapi/CMakeLists.txt1
-rw-r--r--tests/auto/quick/publicapi/publicapi.pro3
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp23
-rw-r--r--tests/auto/quick/qmltests/BLACKLIST5
-rw-r--r--tests/auto/quick/qmltests/data/TestWebEngineView.qml16
-rw-r--r--tests/auto/quick/qmltests/data/tst_action.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_activeFocusOnPress.qml4
-rw-r--r--tests/auto/quick/qmltests/data/tst_audioMuted.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_certificateError.qml30
-rw-r--r--tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_download.qml10
-rw-r--r--tests/auto/quick/qmltests/data/tst_filePicker.qml10
-rw-r--r--tests/auto/quick/qmltests/data/tst_findText.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_focusOnNavigation.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_fullScreenRequest.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_geopermission.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_getUserMedia.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_inputMethod.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_keyboardEvents.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_linkHovered.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadFail.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadHtml.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadProgress.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadRecursionCrash.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_mouseClick.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_mouseMove.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationHistory.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationRequested.qml30
-rw-r--r--tests/auto/quick/qmltests/data/tst_newViewRequest.qml32
-rw-r--r--tests/auto/quick/qmltests/data/tst_notification.qml10
-rw-r--r--tests/auto/quick/qmltests/data/tst_properties.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_runJavaScript.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_scrollPosition.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_settings.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_titleChanged.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml14
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScripts.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_viewSource.qml10
-rw-r--r--tests/auto/quick/qmltests/data/tst_webchannel.qml8
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/TestParams/FilePickerParams.qml2
-rw-r--r--tests/auto/quick/qmltests/mock-delegates/TestParams/JSDialogParams.qml2
-rw-r--r--tests/auto/quick/qmltests/qmltests.pro134
-rw-r--r--tests/auto/quick/qmltests/tst_qmltests.cpp4
-rw-r--r--tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro6
-rw-r--r--tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp4
-rw-r--r--tests/auto/quick/qquickwebengineview/CMakeLists.txt1
-rw-r--r--tests/auto/quick/qquickwebengineview/qquickwebengineview.pro6
-rw-r--r--tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp8
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/CMakeLists.txt1
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro4
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp2
-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/quick.pro16
-rw-r--r--tests/auto/quick/tests.pri20
-rw-r--r--tests/auto/quick/uidelegates/tst_uidelegates.cpp7
-rw-r--r--tests/auto/shared/http.pri4
-rw-r--r--tests/auto/shared/https.pri4
-rw-r--r--tests/auto/shared/httpsserver.qrc6
-rw-r--r--tests/auto/widgets/accessibility/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/accessibility/accessibility.pro1
-rw-r--r--tests/auto/widgets/defaultsurfaceformat/defaultsurfaceformat.pro1
-rw-r--r--tests/auto/widgets/defaultsurfaceformat/tst_defaultsurfaceformat.qrc5
-rw-r--r--tests/auto/widgets/favicon/favicon.pro1
-rw-r--r--tests/auto/widgets/favicon/tst_favicon.qrc14
-rw-r--r--tests/auto/widgets/loadsignals/loadsignals.pro2
-rw-r--r--tests/auto/widgets/loadsignals/tst_loadsignals.qrc13
-rw-r--r--tests/auto/widgets/offscreen/offscreen.pro6
-rw-r--r--tests/auto/widgets/offscreen/tst_offscreen.qrc6
-rw-r--r--tests/auto/widgets/printing/printing.pro10
-rw-r--r--tests/auto/widgets/printing/tst_printing.cpp12
-rw-r--r--tests/auto/widgets/printing/tst_printing.qrc5
-rw-r--r--tests/auto/widgets/proxy/CMakeLists.txt2
-rw-r--r--tests/auto/widgets/proxy/proxy.pro9
-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/qwebenginedownloadrequest/qwebenginedownloadrequest.pro3
-rw-r--r--tests/auto/widgets/qwebenginehistory/qwebenginehistory.pro1
-rw-r--r--tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.qrc10
-rw-r--r--tests/auto/widgets/qwebenginepage/qwebenginepage.pro3
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp113
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc32
-rw-r--r--tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro4
-rw-r--r--tests/auto/widgets/qwebenginescript/qwebenginescript.pro1
-rw-r--r--tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp31
-rw-r--r--tests/auto/widgets/qwebenginescript/tst_qwebenginescript.qrc11
-rw-r--r--tests/auto/widgets/qwebengineview/qwebengineview.pro2
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp18
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc11
-rw-r--r--tests/auto/widgets/schemes/schemes.pro3
-rw-r--r--tests/auto/widgets/shutdown/shutdown.pro1
-rw-r--r--tests/auto/widgets/spellchecking/CMakeLists.txt4
-rw-r--r--tests/auto/widgets/spellchecking/spellchecking.pro24
-rw-r--r--tests/auto/widgets/spellchecking/tst_spellchecking.qrc5
-rw-r--r--tests/auto/widgets/tests.pri21
-rw-r--r--tests/auto/widgets/touchinput/touchinput.pro2
-rw-r--r--tests/auto/widgets/widgets.pro47
-rw-r--r--tests/quicktestbrowser/BrowserWindow.qml2
-rw-r--r--tests/quicktestbrowser/resources.qrc8
-rw-r--r--tests/tests.pro7
543 files changed, 3695 insertions, 7767 deletions
diff --git a/.cmake.conf b/.cmake.conf
index 4e73b3d6..75aec070 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1 +1,2 @@
-set(QT_REPO_MODULE_VERSION "6.2.0")
+set(QT_REPO_MODULE_VERSION "6.3.0")
+set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
diff --git a/.qmake.conf b/.qmake.conf
deleted file mode 100644
index f96b92c5..00000000
--- 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 = 6.2.0
diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
new file mode 100644
index 00000000..fbc22308
--- /dev/null
+++ b/CHROMIUM_VERSION
@@ -0,0 +1,3 @@
+
+Based on Chromium version: 90.0.4430.228
+Patched with security patches up to Chromium version: 94.0.4606.61
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54b75096..35248b6f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,265 +4,28 @@ include(.cmake.conf)
include(ExternalProject)
include(cmake/Functions.cmake)
-project(QtWebEngineRepoSuperBuild
+project(QtWebEngine
VERSION "${QT_REPO_MODULE_VERSION}"
- DESCRIPTION "Qt WebEngine Libraries"
+ DESCRIPTION "QtWebEngine and QtPdf modules"
HOMEPAGE_URL "https://qt.io/"
LANGUAGES CXX C
)
-option(FORCE_TEST_RUN "Forces test run after compilation" FALSE)
-
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
-
-# coin configures 'just' for test build
-if(QT_BUILD_STANDALONE_TESTS)
- qt_build_repo()
- return()
-endif()
-
-set(installDir ${CMAKE_CURRENT_BINARY_DIR}/install)
-
-### FEATURES
-
-qt_build_repo_begin()
-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)
-include(src/core/api/configure.cmake)
-include(src/webenginequick/configure.cmake)
-qt_feature_module_end(ONLY_EVALUATE_FEATURES)
-
-if(NOT ${webEngineSupport})
- add_custom_target(WebEngineErrorMessage ALL
- ${CMAKE_COMMAND} -E cmake_echo_color --red "QtWebEngine will not be built: ${webEngineError}"
- COMMENT "Check QtWebEngine support")
- message("-- Support check for QtWebEngine failed: ${webEngineError}")
- set(QT_FEATURE_qtwebengine_build OFF CACHE BOOL "Build QtWebEngine" FORCE)
-endif()
-
-if(NOT ${pdfSupport})
- add_custom_target(PdfErrorMessage ALL
- ${CMAKE_COMMAND} -E cmake_echo_color --red "QtPdf will not be built: ${pdfError}"
- COMMENT "Check QtPdf support")
- message("-- Support check for QtPdf failed: ${pdfError}")
- set(QT_FEATURE_qtpdf_build OFF CACHE BOOL "Build QtPdf" FORCE)
-endif()
-
-if(NOT QT_FEATURE_qtwebengine_build AND NOT QT_FEATURE_qtpdf_build)
- # coin missing artifacts workaround
- install(FILES coin-bug-707 DESTINATION ${INSTALL_DATADIR})
- return()
-endif()
-
-add_subdirectory(src/core/api)
-add_subdirectory(src/core/tools)
-add_subdirectory(src/process)
-add_subdirectory(src/webenginewidgets)
-add_subdirectory(src/webenginequick)
-qt_build_repo_end()
-get_install_config(installConfig)
-
-### NINJA
-
-if(NOT Ninja_FOUND)
- externalproject_add(ninja
- SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/src/ninja
- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/ninja
- INSTALL_DIR ${installDir}
- PREFIX ninja
- USES_TERMINAL_BUILD ON
- CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
- -DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
- )
-endif()
-
-### GN
-
-if(NOT Gn_FOUND)
- externalproject_add(gn
- SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/src/gn
- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gn
- INSTALL_DIR ${installDir}
- PREFIX gn
- USES_TERMINAL_BUILD ON
- 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=${CMAKE_CURRENT_BINARY_DIR}
- )
-endif()
-
-
-### LIBS
-
-# on windows source path can be specified without hard drive letter,
-# however we need that for gn use REALPATH
-get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" REALPATH)
-get_qt_features(featureList webengine)
-get_qt_features(featureList qtwebengine)
-
-if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND QT_SUPERBUILD)
- set(CMAKE_TOOLCHAIN_FILE "${CMAKE_BINARY_DIR}/qtbase/lib/cmake/Qt6/qt.toolchain.cmake")
- list(APPEND libsCmakeArgs
- "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
- )
-endif()
-
-if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
- message(FATAL_ERROR "QtWebEngine build requires CMAKE_TOOLCHAIN_FILE. Please provide one or use qt-cmake.")
-endif()
-
-list(TRANSFORM featureList PREPEND "-D")
-list(APPEND libsCmakeArgs
- "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
- "-DWEBENGINE_ROOT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}"
- "-DWEBENGINE_ROOT_SOURCE_DIR=${WEBENGINE_ROOT_SOURCE_DIR}"
- "-DWEBENGINE_REPO_BUILD=TRUE"
- "${featureList}"
-)
-
-if (CMAKE_C_COMPILER_LAUNCHER)
- list(APPEND libsCmakeArgs "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}")
-endif()
-if (CMAKE_CXX_COMPILER_LAUNCHER)
- list(APPEND libsCmakeArgs "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}")
-endif()
-
-if(QT_HOST_PATH)
- list(APPEND libsCmakeArgs "-DQT_HOST_PATH=${QT_HOST_PATH}")
-endif()
-
-if(LINUX)
- set(cmd "${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/src")
- file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/build.sh CONTENT "ulimit -n 4096 && ${cmd}\n")
- set(coinBug699 COMMAND bash build.sh)
-else()
- if ("${CMAKE_DEFAULT_CONFIGS}" STREQUAL "all")
- set(coinBug699 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/src)
- else()
- set(coinBug699 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/src --config $<CONFIG>)
- endif()
-endif()
-
-# use qtwebengine as name since it is should visible for topLevel builds
-externalproject_add(qtwebengine
- SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/src
- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/src
- PREFIX libs
- USES_TERMINAL_CONFIGURE ON
- USES_TERMINAL_BUILD ON
- BUILD_ALWAYS TRUE
- CMAKE_ARGS ${libsCmakeArgs}
- BUILD_COMMAND ${CMAKE_COMMAND} -E echo "Starting $<CONFIG> build"
- ${coinBug699}
- COMMAND ${CMAKE_COMMAND} -E echo "$<CONFIG> build complete"
- # TODO: this is aworkaround for broken qt_lib_webengine*.pri files,
- # coin does the in-source build and later calls qmake to build examples
- # and this leftover file gets sucked instead of install or src/mkspecs,
- # simply remove it, we need to implment a dry run in qt base to fix it.
- COMMAND ${CMAKE_COMMAND} -E remove_directory ../mkspecs
+find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS
+ Gui Widgets Network OpenGL Quick Qml PrintSupport
+ WebChannel Positioning QuickControls2 Test QuickWidgets QuickTest WebSockets Designer
)
-# required for topLevel build
-qt_get_tool_target_name(cacheGenTarget qmlcachegen)
-add_implicit_dependencies(qtwebengine Core Gui Widgets Network OpenGL
- OpenGLWidgets Quick QuickWidgets Qml PrintSupport WebChannel Positioning ${cacheGenTarget}
-)
-
-# Ensure the libs project is reconfigured if the root project is reconfigured, so that the
-# correct CMake and qmake support files are used when building examples, rather than
-# using the incomplete support files created by the root project.
-qt_internal_add_external_project_dependency_to_root_project(qtwebengine)
-
-if(QT_BUILD_EXAMPLES AND BUILD_SHARED_LIBS)
- externalproject_add(qtwebengine_examples
- SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/examples
- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/examples
- PREFIX examples
- USES_TERMINAL_BUILD ON
- BUILD_ALWAYS TRUE
- CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
- "${featureList}"
- )
- externalproject_add_stepdependencies(qtwebengine_examples install qtwebengine)
-endif()
-
-if(FORCE_TEST_RUN OR QT_BUILD_TESTS)
- find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS QuickTest Test)
- find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS WebSockets)
- unset(testRunCommand)
- if(FORCE_TEST_RUN)
- set(testRunCommand TEST_COMMAND ctest)
- endif()
- externalproject_add(qtwebengine_tests
- SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/tests
- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/tests
- PREFIX tests
- USES_TERMINAL_BUILD ON
- USES_TERMINAL_TEST ON
- BUILD_ALWAYS TRUE
- CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
- "${featureList}"
- INSTALL_COMMAND ""
- ${testRunCommand}
- )
- externalproject_add_stepdependencies(qtwebengine_tests install qtwebengine)
- add_implicit_dependencies(qtwebengine_tests Test QuickTest WebSockets)
- if(QT_BUILD_EXAMPLES AND BUILD_SHARED_LIBS)
- externalproject_add_stepdependencies(qtwebengine_tests install qtwebengine_examples)
- endif()
-endif()
-
-if(NOT Gn_FOUND)
- externalproject_add_stepdependencies(qtwebengine install gn)
-endif()
-
-if(NOT Ninja_FOUND)
- externalproject_add_stepdependencies(gn install ninja)
-endif()
-
-if(NOT QT_FEATURE_framework)
- # install resources (again), coin calls install with DESTDIR
- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/translations/qtwebengine_locales
- DESTINATION ${CMAKE_INSTALL_PREFIX}/translations
- )
- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- )
-endif()
-
-### CROSS BUILD SETUP
-
-# install gn for cross build
-# TODO: is this really needed, should we skip it and just build gn as host build ?
-if(LINUX AND NOT Gn_FOUND OR INSTALL_GN)
- set(INSTALL_GN 1 CACHE INTERNAL "")
- install(
- PROGRAMS ${installDir}/bin/gn
- CONFIGURATIONS ${installConfig}
- RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}"
- )
+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()
-if(CMAKE_CROSSCOMPILING)
- externalproject_add(hostBuild
- SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/src/host
- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/host
- PREFIX host
- USES_TERMINAL_BUILD ON
- CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${QT_HOST_PATH}/lib/cmake/Qt6/qt.toolchain.cmake
- -DWEBENGINE_ROOT_BUILD_DIR=${CMAKE_CURRENT_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}
- )
- externalproject_add_stepdependencies(qtwebengine install hostBuild)
-endif()
+set(WEBENGINE_MODULE_BUILD TRUE)
+qt_build_repo()
diff --git a/cmake/FindGn.cmake b/cmake/FindGn.cmake
index abfa0fe2..6bef6009 100644
--- a/cmake/FindGn.cmake
+++ b/cmake/FindGn.cmake
@@ -1,10 +1,14 @@
-if (NOT DEFINED WEBENGINE_ROOT_BUILD_DIR)
+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)
endif()
+# script mode does not have QT_HOST_PATH or INSTALL_LIBEXECDIR instead it uses QT_HOST_GN_PATH
+if(NOT QT_HOST_GN_PATH STREQUAL "")
+ find_program(Gn_EXECUTABLE NAMES gn PATHS ${QT_HOST_GN_PATH} NO_DEFAULT_PATH)
+endif()
find_program(Gn_EXECUTABLE NAMES gn)
if(Gn_EXECUTABLE)
@@ -15,7 +19,7 @@ if(Gn_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
-string(REGEX MATCHALL "([1-9]\.[0-9]\.[0-9])\.qtwebengine\.qt\.io.*" Gn_QT_VERSION "${Gn_VERSION}")
+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()
@@ -31,7 +35,7 @@ find_package_handle_standard_args(Gn
Gn_EXECUTABLE
)
-if(Gn_FOUND AND NOT TARGET Gn::gn)
+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()
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 94d2949c..19d6b0ca 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1,21 +1,25 @@
-function(assertTargets errorResult supportResult)
- if(NOT DEFINED ${supportResult})
- set(${supportResult} ON PARENT_SCOPE)
- set(${supportResult} ON)
- endif()
- if(${${supportResult}})
- list(REMOVE_ITEM ARGN ${errorResult})
- list(REMOVE_ITEM ARGN ${supportResult})
- foreach(qtTarget IN ITEMS ${ARGN})
- if(NOT TARGET Qt::${qtTarget})
- set(${errorResult} "Missing required Qt::${qtTarget}." PARENT_SCOPE)
- set(${supportResult} OFF PARENT_SCOPE)
- return()
- endif()
- endforeach()
- endif()
+function(assertTargets)
+ qt_parse_all_arguments(arg "add_check_for_support"
+ "" "" "MODULES;TARGETS" "${ARGN}"
+ )
+ 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: remove me
function(add_implicit_dependencies target)
if(TARGET ${target})
list(REMOVE_ITEM ARGN ${target})
@@ -27,29 +31,31 @@ function(add_implicit_dependencies target)
endif()
endfunction()
-
# TODO: this should be idealy in qtbase
-function(add_check_for_support errorResult supportResult)
- if(NOT DEFINED ${supportResult})
- set(${supportResult} ON PARENT_SCOPE)
- set(${supportResult} ON)
- endif()
- if(${${supportResult}})
- qt_parse_all_arguments(arg "add_check_for_support"
- "" "MODULE" "MESSAGE;CONDITION" "${ARGN}")
- if("x${arg_CONDITION}" STREQUAL x)
- set(arg_CONDITION ON)
+function(add_check_for_support)
+ qt_parse_all_arguments(arg "add_check_for_support"
+ "" "" "MODULES;MESSAGE;CONDITION" "${ARGN}"
+ )
+ foreach(module ${arg_MODULES})
+ if(NOT DEFINED ${module}_SUPPORT)
+ set(${module}_SUPPORT ON PARENT_SCOPE)
+ set(${module}_SUPPORT ON)
endif()
- qt_evaluate_config_expression(result ${arg_CONDITION})
- if(NOT ${result})
- set(${supportResult} OFF PARENT_SCOPE)
- set(${errorResult} ${arg_MESSAGE} PARENT_SCOPE)
+ 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 "${arg_MODULE} won't be built. ${arg_MESSAGE}"
+ MESSAGE "${module} won't be built. ${arg_MESSAGE}"
CONDITION ON
)
+ endif()
endif()
- endif()
+ endforeach()
endfunction()
function(get_qt_features outList module)
@@ -69,58 +75,85 @@ function(get_qt_features outList module)
endif()
endfunction()
-function(get_configure_mode configureMode)
- if(NOT DEFINED WEBENGINE_REPO_BUILD AND NOT DEFINED QT_SUPERBUILD)
- set(${configureMode} NO_CONFIG_HEADER_FILE NO_SYNC_QT PARENT_SCOPE)
+function(create_cxx_config cmakeTarget arch configFileName)
+ if(NOT QT_SUPERBUILD)
+ get_target_property(mocFilePath Qt6::moc IMPORTED_LOCATION)
+ else()
+ set(mocFilePath "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/moc${CMAKE_EXECUTABLE_SUFFIX}")
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(make_config_for_gn target configFileName)
- if(NOT DEFINED WEBENGINE_REPO_BUILD)
- file(GENERATE
- OUTPUT $<CONFIG>/${configFileName}.cxx.cmake
- CONTENT [[
- set(GN_INCLUDES $<TARGET_PROPERTY:INCLUDE_DIRECTORIES>)
- set(GN_DEFINES $<TARGET_PROPERTY:COMPILE_DEFINITIONS>)
- set(GN_LIBS $<TARGET_PROPERTY:LINK_LIBRARIES>)
- set(GN_LINK_OPTIONS $<TARGET_PROPERTY:LINK_OPTIONS>)
- set(GN_CXX_COMPILE_OPTIONS $<TARGET_PROPERTY:COMPILE_OPTIONS>)]]
- CONDITION $<COMPILE_LANGUAGE:CXX>
- TARGET ${target})
- file(GENERATE
- OUTPUT $<CONFIG>/${configFileName}.c.cmake
- CONTENT [[ set(GN_C_COMPILE_OPTIONS $<TARGET_PROPERTY:COMPILE_OPTIONS>)]]
- CONDITION $<COMPILE_LANGUAGE:C>
- TARGET ${target})
- endif()
-endfunction()
-
-function(make_install_only target)
- if(NOT DEFINED WEBENGINE_REPO_BUILD)
- set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL TRUE)
- endif()
+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(add_gn_target target)
+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")
+ PREFIX "GN"
+ CONFIG ${config}
+ ARCH ${arch}
+ )
endfunction()
-function(read_gn_target target filePath)
+function(init_gn_config filePath)
include(${filePath})
- applyToGnTarget(${target})
+ set_directory_properties(PROPERTIES
+ ELEMENTS "${ELEMENTS}"
+ PREFIX "${PREFIX}"
+ )
+ applyToGnTarget(DIRECTORY)
endfunction()
-macro(applyToGnTarget target)
- get_target_property(elementList ${target} ELEMENTS)
- get_target_property(prefix ${target} PREFIX)
+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(TARGET ${target} APPEND PROPERTY ${prefix}_${element} ${${prefix}_${element}})
+ set_property(${type} ${target} APPEND PROPERTY ${prefix}_${element} ${${prefix}_${element}})
endif()
endforeach()
endmacro()
@@ -134,7 +167,7 @@ function(extend_gn_target target)
qt_evaluate_config_expression(result ${GN_CONDITION})
if(${result})
message(DEBUG "extend_gn_target(${target} CONDITION ${GN_CONDITION} ...): Evaluated")
- applyToGnTarget(${target})
+ applyToGnTarget(TARGET ${target})
endif()
endfunction()
@@ -156,15 +189,14 @@ function(extend_gn_list outList)
set(${outList} "${${outList}}" PARENT_SCOPE)
endfunction()
-function(configure_gn_target target configType inFilePath outFilePath)
-
- # GN_CONFIG
- string(TOUPPER ${configType} GN_CONFIG)
+function(configure_gn_target sourceDir inFilePath outFilePath)
+ # FIXME: GN_CONFIG
+ set(GN_CONFIG NOTUSED)
# GN_SOURCES GN_HEADERS
- get_target_property(gnSources ${target} GN_SOURCES)
+ get_property(gnSources DIRECTORY PROPERTY GN_SOURCES)
foreach(gnSourceFile ${gnSources})
- get_filename_component(gnSourcePath ${gnSourceFile} REALPATH)
+ get_filename_component(gnSourcePath ${sourceDir}/${gnSourceFile} REALPATH)
list(APPEND sourceList \"${gnSourcePath}\")
endforeach()
set(GN_HEADERS ${sourceList})
@@ -173,7 +205,7 @@ function(configure_gn_target target configType inFilePath outFilePath)
list(FILTER GN_SOURCES EXCLUDE REGEX "^.+\\.h\"$")
# GN_DEFINES
- get_target_property(gnDefines ${target} GN_DEFINES)
+ get_property(gnDefines DIRECTORY PROPERTY GN_DEFINES)
list(REMOVE_DUPLICATES gnDefines)
foreach(gnDefine ${gnDefines})
list(APPEND GN_ARGS_DEFINES \"-D${gnDefine}\")
@@ -181,7 +213,7 @@ function(configure_gn_target target configType inFilePath outFilePath)
endforeach()
# GN_INCLUDES
- get_target_property(gnIncludes ${target} GN_INCLUDES)
+ get_property(gnIncludes DIRECTORY PROPERTY GN_INCLUDES)
list(REMOVE_DUPLICATES gnIncludes)
foreach(gnInclude ${gnIncludes})
get_filename_component(gnInclude ${gnInclude} REALPATH)
@@ -190,27 +222,30 @@ function(configure_gn_target target configType inFilePath outFilePath)
endforeach()
# MOC
- get_target_property(GN_MOC_BIN_IN Qt6::moc IMPORTED_LOCATION)
- set(GN_ARGS_MOC_BIN \"${GN_MOC_BIN_IN}\")
+ get_property(mocFilePath DIRECTORY PROPERTY GN_MOC_PATH)
+ set(GN_ARGS_MOC_BIN \"${mocFilePath}\")
# GN_CFLAGS_CC
- get_target_property(gnCxxCompileOptions ${target} GN_CXX_COMPILE_OPTIONS)
+ 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_target_property(gnCCompileOptions ${target} GN_C_COMPILE_OPTIONS)
+ 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 "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+ get_filename_component(GN_SOURCE_ROOT "${sourceDir}" REALPATH)
- if(MACOS)
+ # GN_RSP_PREFIX
+ get_property(GN_RSP_PREFIX DIRECTORY PROPERTY GN_RSP_PREFIX)
+
+ if(APPLE) # this runs in scrpit mode without qt-cmake so on MACOS here
recoverFrameworkBuild(GN_INCLUDE_DIRS GN_CFLAGS_C)
endif()
@@ -250,8 +285,8 @@ function(get_install_config result)
endif()
endfunction()
-macro(assertRunAsTopLevelBuild condition)
- if(NOT DEFINED WEBENGINE_REPO_BUILD AND ${condition})
+macro(assertRunAsTopLevelBuild)
+ if(NOT DEFINED WEBENGINE_REPO_BUILD)
message(FATAL_ERROR "This cmake file should run as top level build.")
return()
endif()
@@ -275,7 +310,7 @@ endfunction()
# forward declarations of NSString.
function(get_forward_declaration_macro result)
if(MACOS)
- set(${result} "Q_FORWARD_DECLARE_OBJC_CLASS(name)=class name;" PARENT_SCOPE)
+ 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()
@@ -306,152 +341,144 @@ function(get_darwin_sdk_version result)
endif()
endfunction()
-function(extend_target_with_gn_objects target config cmakeFile stampFile)
-
- include(${buildDir}/${config}/${cmakeFile})
-
+function(add_ninja_target target cmakeTarget ninjaTarget config arch buildDir)
string(TOUPPER ${config} cfg)
- add_library(GnObjects_${target}_${config} OBJECT IMPORTED GLOBAL)
- target_link_libraries(${target} PRIVATE $<$<CONFIG:${config}>:GnObjects_${target}_${config}>)
- add_custom_target(ninja_${target}_${config} DEPENDS ${buildDir}/${config}/${stampFile})
- add_dependencies(GnObjects_${target}_${config} ninja_${target}_${config})
- #TODO: remove GnObjects_${target}_${config} with CMAKE 3.20
- set_property(TARGET GnObjects_${target}_${config}
- PROPERTY IMPORTED_OBJECTS_${cfg} ${${cfg}_NINJA_OBJECTS}
+ add_custom_target(${target} DEPENDS ${buildDir}/${config}/${arch}/${ninjaTarget}.stamp)
+ set_target_properties(${target} PROPERTIES
+ CONFIG ${config}
+ ARCH ${arch}
+ CMAKE_TARGET ${cmakeTarget}
+ NINJA_TARGET ${ninjaTarget}
)
- set_source_files_properties(${${cfg}_NINJA_OBJECTS} PROPERTIES GENERATED TRUE)
+endfunction()
- if(LINUX)
- target_link_libraries(${target}
- PRIVATE "-Wl,--start-group" "$<$<CONFIG:${config}>:${${cfg}_NINJA_ARCHIVES}>" "-Wl,--end-group")
- else()
- target_link_libraries(${target} PRIVATE "$<$<CONFIG:${config}>:${${cfg}_NINJA_ARCHIVES}>")
- endif()
+function(copy_response_files target)
+ get_target_property(config ${target} CONFIG)
+ get_target_property(ninjaTarget ${target} NINJA_TARGET)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ list(REMOVE_ITEM ARGN ${target})
+ foreach(rsp IN ITEMS ${ARGN})
+ set(rsp_dst "CMakeFiles_${ninjaTarget}_${config}_${rsp}.rsp")
+ set(rsp_src "${${rsp}_rsp}")
+ 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(${rsp}_rsp ${rsp_dst} PARENT_SCOPE)
+ add_custom_target(${cmakeTarget}_${rsp}_copy_${config}
+ DEPENDS ${rsp_output}
+ )
+ add_dependencies(${cmakeTarget} ${cmakeTarget}_${rsp}_copy_${config})
+ endforeach()
+endfunction()
- target_link_libraries(${target} PUBLIC "$<$<CONFIG:${config}>:${${cfg}_NINJA_LIBS}>")
+function(extend_cmake_target target buildDir)
+ 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")
+ if(LINUX)
+ target_link_options(${cmakeTarget} PRIVATE
+ "$<$<CONFIG:${config}>:@${objects_rsp}>"
+ )
+ target_link_libraries(${cmakeTarget} PRIVATE
+ "-Wl,--start-group $<$<CONFIG:${config}>:@${archives_rsp}> -Wl,--end-group"
+ )
+ # linker here options are just to prevent processing it by cmake
+ target_link_libraries(${cmakeTarget} PRIVATE
+ "-Wl,--no-fatal-warnings $<$<CONFIG:${config}>:@${libs_rsp}> -Wl,--no-fatal-warnings"
+ )
- # we depend on stampFile, but ninja backend generator needs more (create once)
- if(stampFile)
- add_custom_command(OUTPUT ${${cfg}_NINJA_OBJECTS} ${${cfg}_NINJA_ARCHIVES}
- DEPENDS ${buildDir}/${config}/${stampFile}
+ endif()
+ if(MACOS)
+ target_link_options(${cmakeTarget} PRIVATE
+ "$<$<CONFIG:${config}>:@${objects_rsp}>"
+ "$<$<CONFIG:${config}>:@${archives_rsp}>"
+ "$<$<CONFIG:${config}>:@${libs_rsp}>"
)
- add_custom_target(generate_${target}_${cfg}
- DEPENDS ${${cfg}_NINJA_OBJECTS} ${${cfg}_NINJA_ARCHIVES}
+ endif()
+ if(WIN32)
+ copy_response_files(${target} objects archives libs)
+ target_link_options(${cmakeTarget} PRIVATE
+ "$<$<CONFIG:${config}>:@${objects_rsp}>"
+ "$<$<CONFIG:${config}>:@${archives_rsp}>"
+ "$<$<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(extend_target_with_gn_libs target config cmakeFile stampFile)
+function(add_rsp_command target buildDir)
+ 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)
string(TOUPPER ${config} cfg)
-
- # Do a partial link of all the archives into a single archive:
- include(${buildDir}/arm64/${config}/${cmakeFile})
- set_source_files_properties(${${cfg}_NINJA_OBJECTS} PROPERTIES GENERATED TRUE)
-
- list(JOIN ${cfg}_NINJA_OBJECTS " " arm64_objects)
- list(JOIN ${cfg}_NINJA_ARCHIVES " " arm64_archives)
- file(WRITE ${buildDir}/arm64/${config}/${target}_gnobjects.rsp ${arm64_objects})
- file(WRITE ${buildDir}/arm64/${config}/${target}_gnarchives.rsp ${arm64_archives})
- add_custom_command(OUTPUT ${buildDir}/arm64/${config}/${target}_gnobjects.rsp
- ${buildDir}/arm64/${config}/${target}_gnarchives.rsp
- DEPENDS ${buildDir}/arm64/${config}/${stampFile})
- add_custom_target(generate_arm64_rsp_${target}_${config}
- DEPENDS
- ${buildDir}/arm64/${config}/${target}_gnobjects.rsp
- ${buildDir}/arm64/${config}/${target}_gnarchives.rsp)
-
add_custom_command(
- OUTPUT ${buildDir}/${config}/arm64_${target}_${config}.a
- BYPRODUCTS ${buildDir}/${config}/arm64_${target}_${config}.o
- COMMAND clang++ -r -nostdlib -arch arm64
- -o ${buildDir}/${config}/arm64_${target}_${config}.o
- -Wl,-keep_private_externs
- @${buildDir}/arm64/${config}/${target}_gnobjects.rsp
- -Wl,-all_load
- @${buildDir}/arm64/${config}/${target}_gnarchives.rsp
+ OUTPUT ${buildDir}/${cmakeTarget}.a
+ BYPRODUCTS
+ ${buildDir}/${cmakeTarget}.o
+ COMMAND clang++ -r -nostdlib -arch ${arch}
+ -o ${buildDir}/${cmakeTarget}.o
+ -Wl,-keep_private_externs
+ @${buildDir}/${ninjaTarget}_objects.rsp
+ -Wl,-all_load
+ @${buildDir}/${ninjaTarget}_archives.rsp
COMMAND ar -cr
- ${buildDir}/${config}/arm64_${target}_${config}.a
- ${buildDir}/${config}/arm64_${target}_${config}.o
+ ${buildDir}/${cmakeTarget}.a
+ ${buildDir}/${cmakeTarget}.o
DEPENDS
- ${buildDir}/arm64/${config}/${stampFile}
- ${buildDir}/arm64/${config}/${target}_gnobjects.rsp
- ${buildDir}/arm64/${config}/${target}_gnarchives.rsp
+ ${buildDir}/${ninjaTarget}.stamp
+ WORKING_DIRECTORY "${buildDir}/../../.."
USES_TERMINAL
VERBATIM
COMMAND_EXPAND_LISTS
)
- add_custom_command(OUTPUT ${${cfg}_NINJA_OBJECTS} ${${cfg}_NINJA_ARCHIVES}
- DEPENDS ${buildDir}/arm64/${config}/${stampFile})
- add_custom_target(generate_arm64_${target}_${config}
- DEPENDS ${${cfg}_NINJA_OBJECTS} ${${cfg}_NINJA_ARCHIVES})
-
- include(${buildDir}/x86_64/${config}/${cmakeFile})
- set_source_files_properties(${${cfg}_NINJA_OBJECTS} PROPERTIES GENERATED TRUE)
-
- list(JOIN ${cfg}_NINJA_OBJECTS " " x64_objects)
- list(JOIN ${cfg}_NINJA_ARCHIVES " " x64_archives)
- file(WRITE ${buildDir}/x86_64/${config}/${target}_gnobjects.rsp ${x64_objects})
- file(WRITE ${buildDir}/x86_64/${config}/${target}_gnarchives.rsp ${x64_archives})
- add_custom_command(OUTPUT ${buildDir}/x86_64/${config}/${target}_gnobjects.rsp
- ${buildDir}/x86_64/${config}/${target}_gnarchives.rsp
- DEPENDS ${buildDir}/x86_64/${config}/${stampFile})
- add_custom_target(generate_x64_rsp_${target}_${config}
- DEPENDS
- ${buildDir}/x86_64/${config}/${target}_gnobjects.rsp
- ${buildDir}/x86_64/${config}/${target}_gnarchives.rsp)
-
- add_custom_command(
- OUTPUT ${buildDir}/${config}/x64_${target}_${config}.a
- BYPRODUCTS ${buildDir}/${config}/x64_${target}_${config}.o
- COMMAND clang++ -r -nostdlib -arch x86_64
- -o ${buildDir}/${config}/x64_${target}_${config}.o
- -Wl,-keep_private_externs
- @${buildDir}/x86_64/${config}/${target}_gnobjects.rsp
- -Wl,-all_load
- @${buildDir}/x86_64/${config}/${target}_gnarchives.rsp
- COMMAND ar -cr
- ${buildDir}/${config}/x64_${target}_${config}.a
- ${buildDir}/${config}/x64_${target}_${config}.o
- DEPENDS
- ${buildDir}/x86_64/${config}/${stampFile}
- ${buildDir}/x86_64/${config}/${target}_gnobjects.rsp
- ${buildDir}/x86_64/${config}/${target}_gnarchives.rsp
- USES_TERMINAL
- VERBATIM
- COMMAND_EXPAND_LISTS
- )
- add_custom_command(OUTPUT ${${cfg}_NINJA_OBJECTS} ${${cfg}_NINJA_ARCHIVES}
- DEPENDS ${buildDir}/x86_64/${config}/${stampFile})
- add_custom_target(generate_x86_64_${target}_${config}
- DEPENDS ${${cfg}_NINJA_OBJECTS} ${${cfg}_NINJA_ARCHIVES})
-
- add_custom_target(generate1_${target}_${config}
- DEPENDS ${buildDir}/${config}/arm64_${target}_${config}.a
- ${buildDir}/${config}/x64_${target}_${config}.a)
+endfunction()
+function(add_lipo_command target buildDir)
+ get_target_property(config ${target} CONFIG)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ set(libs_rsp "${buildDir}/x86_64/${ninjaTarget}_libs.rsp")
# Lipo the object files together to a single fat archive
- add_library(${target}_${config} STATIC IMPORTED GLOBAL)
+ add_library(${cmakeTarget}_${config} STATIC IMPORTED GLOBAL)
add_custom_command(
- OUTPUT ${buildDir}/${config}/lib${target}_${config}.a
+ OUTPUT ${buildDir}/lib${cmakeTarget}.a
COMMAND lipo -create
- -output ${buildDir}/${config}/lib${target}_${config}.a
+ -output ${buildDir}/lib${cmakeTarget}.a
ARGS
- ${buildDir}/${config}/arm64_${target}_${config}.a
- ${buildDir}/${config}/x64_${target}_${config}.a
+ ${buildDir}/arm64/${cmakeTarget}.a
+ ${buildDir}/x86_64/${cmakeTarget}.a
DEPENDS
- ${buildDir}/${config}/arm64_${target}_${config}.a
- ${buildDir}/${config}/x64_${target}_${config}.a
+ ${buildDir}/arm64/${cmakeTarget}.a
+ ${buildDir}/x86_64/${cmakeTarget}.a
USES_TERMINAL
VERBATIM
)
- set_property(TARGET ${target}_${config}
- PROPERTY IMPORTED_LOCATION_${cfg} ${buildDir}/${config}/lib${target}_${config}.a)
- add_custom_target(generate2_${target}_${config}
- DEPENDS ${buildDir}/${config}/lib${target}_${config}.a)
- target_link_libraries(${target} PRIVATE ${target}_${config})
+ set_property(TARGET ${cmakeTarget}_${config}
+ PROPERTY IMPORTED_LOCATION ${buildDir}/lib${cmakeTarget}.a
+ )
+ add_custom_target(lipo_${cmakeTarget}_${config} DEPENDS
+ ${buildDir}/lib${cmakeTarget}.a
+ )
+ add_dependencies(${cmakeTarget}_${config} lipo_${cmakeTarget}_${config})
+ target_link_libraries(${cmakeTarget} PRIVATE ${cmakeTarget}_${config})
# Just link with dynamic libs once
- target_link_libraries(${target} PUBLIC "$<$<CONFIG:${config}>:${${cfg}_NINJA_LIBS}>")
+ # TODO: this is evil hack, since cmake has no idea about libs
+ target_link_options(${cmakeTarget} PRIVATE "$<$<CONFIG:${config}>:@${libs_rsp}>")
endfunction()
function(qt_internal_add_external_project_dependency_to_root_project name)
@@ -564,6 +591,7 @@ function(extract_cflag result cflag)
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)
@@ -612,7 +640,7 @@ function(check_thumb result)
set(${result} FALSE PARENT_SCOPE)
endfunction()
-macro(create_pkg_config_host_wrapper)
+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}")
@@ -643,7 +671,6 @@ macro(append_build_type_setup)
use_sysroot=false
forbid_non_component_debug_builds=false
enable_debugallocation=false
- remove_v8base_debug_symbols=true
treat_warnings_as_errors=false
use_allocator_shim=false
use_allocator="none"
@@ -666,7 +693,7 @@ macro(append_build_type_setup)
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"))
+ if(FEATURE_developer_build OR (${config} STREQUAL "Debug") OR QT_FEATURE_webengine_sanitizer)
list(APPEND gnArgArg
is_official_build=false
from_here_uses_location_builtins=false
@@ -684,49 +711,69 @@ macro(append_build_type_setup)
CONDITION FEATURE_developer_build
)
- # FIXME: Make it configurable
- list(APPEND gnArgArg
- use_jumbo_build=true
- jumbo_file_merge_limit=8
- jumbo_build_excluded=["browser"]
- )
+ if(NOT QT_FEATURE_webengine_full_debug_info)
+ list(APPEND gnArgArg blink_symbol_level=0 remove_v8base_debug_symbols=true)
+ 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
)
+ 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
- )
- if(CLANG AND NOT MACOS)
- # For some reason this doesn't work for our macOS CIs
- get_filename_component(clangBasePath ${CMAKE_CXX_COMPILER} DIRECTORY)
- get_filename_component(clangBasePath ${clangBasePath} DIRECTORY)
- list(APPEND gnArgArg
- clang_base_path="${clangBasePath}"
- clang_use_chrome_plugins=false
- )
- endif()
- if(MACOS)
- get_darwin_sdk_version(macSdkVersion)
- get_filename_component(clangBasePath ${CMAKE_OBJCXX_COMPILER} DIRECTORY)
- get_filename_component(clangBasePath ${clangBasePath} DIRECTORY)
+
+ extend_gn_list(gnArgArg ARGS is_clang CONDITION CLANG)
+ 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()
+
list(APPEND gnArgArg
- use_system_xcode=true
clang_base_path="${clangBasePath}"
clang_use_chrome_plugins=false
- mac_deployment_target="${CMAKE_OSX_DEPLOYMENT_TARGET}"
- mac_sdk_min="${macSdkVersion}"
fatal_linker_warnings=false
- )
+ )
+
+ if(MACOS)
+ list(APPEND gnArgArg
+ use_system_xcode=true
+ mac_deployment_target="${CMAKE_OSX_DEPLOYMENT_TARGET}"
+ mac_sdk_min="${macSdkVersion}"
+ )
+ 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(WIN32)
get_filename_component(windowsSdkPath $ENV{WINDOWSSDKDIR} DIRECTORY)
get_filename_component(visualStudioPath $ENV{VSINSTALLDIR} DIRECTORY)
@@ -738,7 +785,9 @@ macro(append_compiler_linker_sdk_setup)
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
@@ -751,6 +800,10 @@ macro(append_compiler_linker_sdk_setup)
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
@@ -779,7 +832,7 @@ macro(append_compiler_linker_sdk_setup)
endmacro()
macro(append_sanitizer_setup)
- if(QT_FEATURE_sanitizer)
+ if(QT_FEATURE_webengine_sanitizer)
extend_gn_list(gnArgArg
ARGS is_asan
CONDITION address IN_LIST ECM_ENABLE_SANITIZERS
@@ -831,51 +884,205 @@ macro(append_pkg_config_setup)
endif()
endmacro()
-macro(execute_gn)
- get_target_property(gnCmd Gn::gn IMPORTED_LOCATION)
- set(gnArg gen ${buildDir}/${config})
-
- list(APPEND gnArg
- --script-executable=${Python2_EXECUTABLE}
- --root=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium)
- list(JOIN gnArgArg " " gnArgArg)
-
- list(APPEND gnArg "--args=${gnArgArg}")
-
- list(JOIN gnArg " " printArg)
- message("-- Running ${config} Configuration for GN \n-- ${gnCmd} ${printArg}")
- execute_process(
- COMMAND ${gnCmd} ${gnArg}
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
- RESULT_VARIABLE gnResult
- OUTPUT_VARIABLE gnOutput
- ERROR_VARIABLE gnError
+function(add_ninja_command)
+ qt_parse_all_arguments(arg "add_ninja_command"
+ "" "TARGET;OUTPUT;BUILDDIR;MODULE" "BYPRODUCTS" "${ARGN}"
)
-
- if(NOT gnResult EQUAL 0)
- message(FATAL_ERROR "\n-- GN FAILED\n${gnOutput}\n${gnError}")
- else()
- string(REGEX REPLACE "\n$" "" gnOutput "${gnOutput}")
- message("-- GN ${gnOutput}")
- endif()
-endmacro()
-
-macro(execute_ninja ninjaTargets)
string(REPLACE " " ";" NINJAFLAGS "$ENV{NINJAFLAGS}")
- string(REPLACE " " ";" NINJATARGETS "${ninjaTargets} ${ARGN}")
+ list(TRANSFORM arg_BYPRODUCTS PREPEND "${arg_BUILDDIR}/")
add_custom_command(
OUTPUT
- ${buildDir}/${config}/${ninjaTargets}.stamp
- ${sandboxOutput}
- ${buildDir}/${config}/runAlways # use generator expression in CMAKE 3.20
- WORKING_DIRECTORY ${buildDir}/${config}
- COMMENT "Ninja ${arch} ${config} build"
+ ${arg_BUILDDIR}/${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 ${buildDir}/${config}
- ${NINJATARGETS}
+ -C ${arg_BUILDDIR}
+ ${arg_TARGET}
USES_TERMINAL
VERBATIM
COMMAND_EXPAND_LISTS
+ DEPENDS run_${arg_MODULE}_NinjaReady
)
-endmacro()
+endfunction()
+
+function(get_configs result)
+ if(QT_GENERATOR_IS_MULTI_CONFIG)
+ set(${result} ${CMAKE_CONFIGURATION_TYPES} PARENT_SCOPE)
+ else()
+ set(${result} ${CMAKE_BUILD_TYPE} PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(get_architectures result)
+ if(NOT QT_IS_MACOS_UNIVERSAL)
+ set(${result} ${CMAKE_SYSTEM_PROCESSOR} PARENT_SCOPE)
+ else()
+ set(${result} ${CMAKE_OSX_ARCHITECTURES} PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(add_gn_build_aritfacts_to_target cmakeTarget ninjaTarget module buildDir)
+ # 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(config)
+ get_architectures(archs)
+ foreach(config ${configs})
+ foreach(arch ${archs})
+ set(target ${ninjaTarget}_${config}_${arch})
+ add_ninja_target(${target} ${cmakeTarget} ${ninjaTarget} ${config} ${arch} ${buildDir})
+ add_ninja_command(
+ TARGET ${ninjaTarget}
+ OUTPUT ${ninjaTarget}.stamp
+ BUILDDIR ${buildDir}/${config}/${arch}
+ MODULE ${module}
+ )
+ add_dependencies(run_${module}_NinjaDone ${target})
+ set_target_properties(${cmakeTarget} PROPERTIES
+ LINK_DEPENDS ${buildDir}/${config}/${arch}/${ninjaTarget}.stamp
+ )
+ if(QT_IS_MACOS_UNIVERSAL)
+ add_rsp_command(${target} ${buildDir}/${config}/${arch})
+ else()
+ extend_cmake_target(${target} ${buildDir}/${config}/${arch})
+ endif()
+ endforeach()
+ if(QT_IS_MACOS_UNIVERSAL)
+ set(arch ${CMAKE_SYSTEM_PROCESSOR})
+ set(target ${ninjaTarget}_${config}_${arch})
+ add_lipo_command(${target} ${buildDir}/${config})
+ endif()
+ endforeach()
+endfunction()
+
+function(get_config_filenames c_config cxx_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)
+endfunction()
+
+function(add_gn_command)
+ qt_parse_all_arguments(arg "add_gn_command"
+ "" "CMAKE_TARGET;GN_TARGET;MODULE;BUILDDIR" "NINJA_TARGETS;GN_ARGS" "${ARGN}"
+ )
+
+ get_config_filenames(cConfigFileName cxxConfigFileName 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)
+ endforeach()
+ list(TRANSFORM output PREPEND "${arg_BUILDDIR}/")
+
+ if(QT_HOST_PATH)
+ set(QT_HOST_GN_PATH ${QT_HOST_PATH}/${INSTALL_LIBEXECDIR})
+ endif()
+
+ add_custom_command(
+ OUTPUT ${output}
+ COMMAND ${CMAKE_COMMAND}
+ -DBUILD_DIR=${arg_BUILDDIR}
+ -DSOURCE_DIR=${CMAKE_CURRENT_LIST_DIR}
+ -DMODULE=${arg_MODULE}
+ -DQT_HOST_GN_PATH=${QT_HOST_GN_PATH}
+ -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
+ USES_TERMINAL
+ )
+ 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})
+ create_gn_target_config(${arg_GN_TARGET} ${arg_BUILDDIR}/${targetConfigFileName})
+endfunction()
+
+function(create_cxx_configs cmakeTarget arch)
+ get_config_filenames(cConfigFileName cxxConfigFileName targetConfigFileName)
+ create_c_config(${cmakeTarget} ${arch} ${cConfigFileName})
+ create_cxx_config(${cmakeTarget} ${arch} ${cxxConfigFileName})
+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()
diff --git a/cmake/Gn.cmake b/cmake/Gn.cmake
new file mode 100644
index 00000000..e8dc956e
--- /dev/null
+++ b/cmake/Gn.cmake
@@ -0,0 +1,69 @@
+# 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()
+
+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)
+find_package(Python2 2.7.5 REQUIRED)
+
+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)
+
+configure_gn_target(
+ "${sourceDir}"
+ "${WEBENGINE_ROOT_SOURCE_DIR}/src/${module}/configure/BUILD.root.gn.in"
+ "${buildDir}/BUILD.gn"
+)
+
+list(APPEND gnArg
+ --script-executable=${Python2_EXECUTABLE}
+ --root=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium)
+
+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
+)
+
+if(NOT gnResult EQUAL 0)
+ message(FATAL_ERROR "\n-- GN FAILED\n${gnOutput}\n${gnError}")
+else()
+ string(REGEX REPLACE "\n$" "" gnOutput "${gnOutput}")
+ message("-- GN ${gnOutput}")
+endif()
diff --git a/conanfile.py b/conanfile.py
new file mode 100644
index 00000000..d0c0c730
--- /dev/null
+++ b/conanfile.py
@@ -0,0 +1,78 @@
+#############################################################################
+##
+## Copyright (C) 2021 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the release tools 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$
+##
+#############################################################################
+
+from conans import ConanFile
+import re
+from pathlib import Path
+from typing import Dict, Any
+
+_qtwebengine_features = [
+ "qtpdf-build",
+ "qtwebengine-build",
+ "qtwebengine-quick-build",
+ "qtwebengine-widgets-build",
+ "webengine-developer-build",
+]
+
+
+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 {item.replace("-", "_"): ["yes", "no", None] for item in _qtwebengine_features}
+
+ def get_qt_leaf_module_default_options(self) -> Dict[str, Any]:
+ """Implements abstractmethod from qt-conan-common.QtLeafModule"""
+ return {item.replace("-", "_"): None for item in _qtwebengine_features}
diff --git a/configure.cmake b/configure.cmake
index 6d692018..172831c6 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1,6 +1,3 @@
-#### Inputs
-
-#### Libraries
if(QT_CONFIGURE_RUNNING)
function(assertTargets)
@@ -14,11 +11,9 @@ else()
find_package(GPerf)
find_package(BISON)
find_package(FLEX)
- find_package(Protobuf)
find_package(PkgConfig)
find_package(Snappy)
find_package(Nodejs 10.19)
- find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS Gui Widgets Network OpenGL OpenGLWidgets Quick Qml)
endif()
if(PkgConfig_FOUND)
@@ -42,7 +37,7 @@ if(PkgConfig_FOUND)
pkg_check_modules(PNG libpng>=1.6.0)
pkg_check_modules(ZLIB zlib)
pkg_check_modules(RE2 re2 IMPORTED_TARGET)
- pkg_check_modules(ICU icu-uc>=65 icu-i18n>=65)
+ pkg_check_modules(ICU icu-uc>=68 icu-i18n>=68)
pkg_check_modules(WEBP libwebp libwebpmux libwebpdemux)
pkg_check_modules(LCMS2 lcms2)
pkg_check_modules(FREETYPE freetype2 IMPORTED_TARGET)
@@ -54,6 +49,9 @@ if(PkgConfig_FOUND)
endif()
#### Tests
+if(LINUX)
+ check_for_ulimit()
+endif()
qt_config_compile_test(re2
LABEL "re2"
@@ -207,7 +205,17 @@ qt_feature("qtwebengine-quick-build" PRIVATE
)
qt_feature("qtpdf-build" PRIVATE
LABEL "Build Qt PDF"
- PURPOSE "Enables building the Qt PDF rendering module."
+ PURPOSE "Enables building the Qt Pdf modules."
+)
+qt_feature("qtpdf-widgets-build" PRIVATE
+ LABEL "Build Qt PdfWidgets"
+ PURPOSE "Enables building the Qt Pdf module."
+ CONDITION TARGET Qt::Widgets
+)
+qt_feature("qtpdf-quick-build" PRIVATE
+ LABEL "Build Qt PdfQuick"
+ PURPOSE "Enables building the Qt Pdf module."
+ CONDITION TARGET Qt::Quick AND TARGET Qt::Qml
)
qt_feature("webengine-system-ninja" PRIVATE
LABEL "Use system ninja"
@@ -216,7 +224,28 @@ qt_feature("webengine-system-ninja" PRIVATE
qt_feature("webengine-system-gn" PRIVATE
LABEL "Use system gn"
AUTODETECT FALSE
- CONDITION GN_Found
+ CONDITION Gn_FOUND
+)
+# 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"
@@ -270,10 +299,6 @@ qt_feature("webengine-system-libevent" PRIVATE
AUTODETECT FALSE # coin bug 711
CONDITION UNIX AND LIBEVENT_FOUND
)
-qt_feature("webengine-system-protobuf" PRIVATE
- LABEL "protobuf"
- CONDITION UNIX AND Protobuf_FOUND
-)
qt_feature("webengine-system-libxml" PRIVATE
LABEL "libxml2 and libxslt"
CONDITION UNIX AND TEST_libxml2
@@ -326,77 +351,80 @@ else()
set(WIN_ARM_64 OFF)
endif()
-assertTargets(webEngineError webEngineSupport Gui Widgets OpenGL OpenGLWidgets Quick Qml)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+assertTargets(
+ MODULES QtWebEngine QtPdf
+ TARGETS Gui Quick Qml
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR (MACOS AND NOT CMAKE_CROSSCOMPILING)
MESSAGE "Build can be done only on Linux, Windows or macOS."
)
if(LINUX AND CMAKE_CROSSCOMPILING)
get_gn_arch(testArch ${TEST_architecture_arch})
- add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+ add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION testArch
MESSAGE "Cross compiling is not supported for ${TEST_architecture_arch}."
)
endif()
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION NOT QT_FEATURE_static
MESSAGE "Static build is not supported."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION TARGET Nodejs::Nodejs
MESSAGE "node.js version 10.19 or later is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION Python2_FOUND
MESSAGE "Python2 version 2.7.5 or later is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION GPerf_FOUND
MESSAGE "Tool gperf is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION BISON_FOUND
MESSAGE "Tool bison is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION FLEX_FOUND
MESSAGE "Tool flex is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION NOT LINUX OR PkgConfig_FOUND
MESSAGE "A pkg-config support is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+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(webEngineError webEngineSupport
- MODULE QtWebEngine
+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(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine
CONDITION NOT LINUX OR FONTCONFIG_FOUND
MESSAGE "Build requires fontconfig."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine
CONDITION NOT LINUX OR NSS_FOUND
MESSAGE "Build requires nss >= 3.26."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine
CONDITION NOT LINUX OR DBUS_FOUND
MESSAGE "Build requires dbus."
)
@@ -409,19 +437,19 @@ foreach(xs ${xcbSupport})
set(xcbErrorMessage "${xcbErrorMessage} ${xs}:NO")
endif()
endforeach()
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine
CONDITION NOT LINUX OR NOT QT_FEATURE_xcb OR QT_FEATURE_webengine_ozone_x11
MESSAGE "Could not find all necessary libraries for qpa-xcb support.\
${xcbErrorMessage}"
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION NOT WIN32 OR TEST_winversion
MESSAGE "Build requires Visual Studio 2019 or higher."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION
(LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
(LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
@@ -431,18 +459,14 @@ add_check_for_support(webEngineError webEngineSupport
(MACOS AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
MESSAGE "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
)
-add_check_for_support(pdfError pdfSupport
- MODULE QtPdf
- CONDITION OFF
- MESSAGE "QtPdf is missing cmake port."
-)
#### Summary
# > Qt WebEngine Build Features
-qt_configure_add_summary_section(NAME "Build Features")
+qt_configure_add_summary_section(NAME "Qt WebEngine")
qt_configure_add_summary_entry(ARGS "webengine-system-ninja")
qt_configure_add_summary_entry(ARGS "webengine-system-gn")
+qt_configure_add_summary_entry(ARGS "webengine-jumbo-build")
qt_configure_add_summary_entry(ARGS "webengine-developer-build")
# >> Optional system libraries
if(UNIX)
@@ -458,7 +482,6 @@ if(UNIX)
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-protobuf")
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")
@@ -475,13 +498,13 @@ qt_configure_end_summary_section()
qt_configure_add_report_entry(
TYPE NOTE
MESSAGE "QtWebEngine build is disabled by user."
- CONDITION ${webEngineSupport} AND NOT QT_FEATURE_qtwebengine_build
+ CONDITION QtWebEngine_SUPPORT AND NOT QT_FEATURE_qtwebengine_build
)
qt_configure_add_report_entry(
TYPE NOTE
MESSAGE "QtPdf build is disabled by user."
- CONDITION ${pdfSupport} AND NOT QT_FEATURE_qtpdf_build
+ CONDITION QtPdf_SUPPORT AND NOT QT_FEATURE_qtpdf_build
)
qt_configure_add_report_entry(
@@ -489,3 +512,9 @@ qt_configure_add_report_entry(
MESSAGE "Building fat libray with device and simulator architectures will disable NEON."
CONDITION IOS AND simulator AND device AND QT_FEATURE_qtpdf_build
)
+if(PRINT_BFD_LINKER_WARNING)
+ qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "Using bfd linker requires at least 4096 open files limit"
+ )
+endif()
diff --git a/configure.pri b/configure.pri
deleted file mode 100644
index 55766de3..00000000
--- a/configure.pri
+++ /dev/null
@@ -1,558 +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)
- contains(QT_ARCH, "mips64"): 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) "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])\..*") {
- $${1}.path = $$ninja
- export($${1}.path)
- $${1}.cache += path
- export($${1}.cache)
- return(true)
- }
- qtLog("Ninja version too old")
- }
- qtLog("Building own ninja")
- return(false)
-}
-
-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)
- }
- }
- nodejs = $$system_quote($$system_path($$nodejs))
- !qtRunLoggedCommand("$$nodejs --version", version) {
- qtLog("'$$nodejs' didn't run.")
- return(false)
- }
- # at least version 10
- version10 = false
- contains(version, "v([1-9][0-9])\..*"): version10 = true
-
- $${1}.version10 = $$version10
- export($${1}.version10)
- $${1}.cache += version10
- export($${1}.cache)
- 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, 19041): {
- qtwebengine_platformError("requires a Windows SDK version 10.0.19041 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
- lessThan(QMAKE_GCC_MAJOR_VERSION, 5) {
- qtwebengine_platformError("requires at least gcc version 5, but using gcc version $${QMAKE_GCC_MAJOR_VERSION}.$${QMAKE_GCC_MINOR_VERSION}.")
- return(false)
- }
-
- equals(QMAKE_GCC_MAJOR_VERSION, 5): equals(QMAKE_GCC_MINOR_VERSION, 4): equals(QMAKE_GCC_PATCH_VERSION, 0) {
- qtwebengine_platformError("gcc version 5.4.0 is blacklisted due to internal compiler errors.")
- return(false)
- }
-
- return(true)
-}
-
-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
index 5ddaef92..716296a4 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,16 +1,13 @@
dependencies:
../qtdeclarative:
- ref: 5a5b9c2344b961e984a2c860bb0c33022d641f32
+ ref: 50196b622fb4714778e0a33daf0337e2130f08cd
required: true
../qtlocation:
- ref: 91f5e5028e2f2f139c16223aa0616a492df9bf2d
- required: false
- ../qtquickcontrols2:
- ref: 89d3486ad18d782a8141037a2bffb7992118cc78
+ ref: 7f6ee8fa23a92660c4728b950bb14a46d1ec6a5b
required: false
../qttools:
- ref: 651dd2a36714606f4cb7b8b2f8227fd81e581816
+ ref: f9e60737e5e6c98c920b686fff02e88f5e707383
required: false
../qtwebchannel:
- ref: 4e41c690657b0c28337cdacecc37d17bf4414f83
+ ref: 4d362a0425c8adee5ed5a16bba5c19ee1c7ee31e
required: false
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 5c6e1592..06e36ecc 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,34 +1,18 @@
cmake_minimum_required(VERSION 3.16)
-include(${CMAKE_CURRENT_LIST_DIR}/../.cmake.conf)
-
-project(QtWebEngineExamples
- VERSION "${QT_REPO_MODULE_VERSION}"
- DESCRIPTION "Qt WebEngine Examples"
- HOMEPAGE_URL "https://qt.io/"
- LANGUAGES CXX C
-)
-
-# Make sure we use the fixed BASE argument of qt_add_resource.
-set(QT_USE_FIXED_QT_ADD_RESOURCE_BASE TRUE)
-
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
-find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS WebEngineCore WebEngineWidgets WebEngineQuick QuickControls2)
-qt_build_repo_begin()
qt_examples_build_begin()
-
-if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_quick_build)
- add_subdirectory(webengine)
+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()
-if(QT_FEATURE_qtwebengine_build AND QT_FEATURE_qtwebengine_widgets_build)
- add_subdirectory(webenginewidgets)
-endif()
-if(QT_FEATURE_qtpdf_build )
- add_subdirectory(pdf)
-endif()
-if(QT_FEATURE_qtpdf_build AND QT_FEATURE_pdf_widgets)
- add_subdirectory(pdfwidgets)
-endif()
-
qt_examples_build_end()
-qt_build_repo_end()
diff --git a/examples/examples.pro b/examples/examples.pro
index 793e46be..4fffce57 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -1,7 +1,7 @@
TEMPLATE=subdirs
-qtHaveModule(webenginequick): SUBDIRS += webengine
+qtHaveModule(webenginequick): SUBDIRS += webenginequick
qtHaveModule(webenginewidgets): SUBDIRS += webenginewidgets
qtHaveModule(pdf): SUBDIRS += pdf
qtHaveModule(pdfwidgets): SUBDIRS += pdfwidgets
diff --git a/examples/pdf/CMakeLists.txt b/examples/pdf/CMakeLists.txt
new file mode 100644
index 00000000..cca6c03d
--- /dev/null
+++ b/examples/pdf/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_subdirectory(pdfviewer)
+add_subdirectory(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 00000000..141da88b
--- /dev/null
+++ b/examples/pdf/multipage/CMakeLists.txt
@@ -0,0 +1,62 @@
+cmake_minimum_required(VERSION 3.16)
+project(multipage LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/pdf/multipage")
+
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Qml)
+
+qt_add_executable(multipage
+ main.cpp
+)
+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/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"
+)
+
+qt6_add_resources(multipage "viewer"
+ PREFIX
+ "/pdfviewer"
+ 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/viewer.qml b/examples/pdf/multipage/viewer.qml
index f66c8d38..ed84d554 100644
--- a/examples/pdf/multipage/viewer.qml
+++ b/examples/pdf/multipage/viewer.qml
@@ -47,14 +47,14 @@
** $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
+import QtQml // workaround for QTBUG-82873
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Pdf
+import QtQuick.Shapes
+import QtQuick.Window
+import Qt.labs.platform as Platform
ApplicationWindow {
id: root
@@ -72,7 +72,7 @@ ApplicationWindow {
ToolButton {
action: Action {
shortcut: StandardKey.Open
- icon.source: "resources/document-open.svg"
+ icon.source: "qrc:/pdfviewer/resources/document-open.svg"
onTriggered: fileDialog.open()
}
}
@@ -80,7 +80,7 @@ ApplicationWindow {
action: Action {
shortcut: StandardKey.ZoomIn
enabled: view.renderScale < 10
- icon.source: "resources/zoom-in.svg"
+ icon.source: "qrc:/pdfviewer/resources/zoom-in.svg"
onTriggered: view.renderScale *= Math.sqrt(2)
}
}
@@ -88,46 +88,46 @@ ApplicationWindow {
action: Action {
shortcut: StandardKey.ZoomOut
enabled: view.renderScale > 0.1
- icon.source: "resources/zoom-out.svg"
+ icon.source: "qrc:/pdfviewer/resources/zoom-out.svg"
onTriggered: view.renderScale /= Math.sqrt(2)
}
}
ToolButton {
action: Action {
- icon.source: "resources/zoom-fit-width.svg"
+ icon.source: "qrc:/pdfviewer/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:/pdfviewer/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:/pdfviewer/resources/zoom-original.svg"
onTriggered: view.resetScale()
}
}
ToolButton {
action: Action {
shortcut: "Ctrl+L"
- icon.source: "resources/rotate-left.svg"
+ icon.source: "qrc:/pdfviewer/resources/rotate-left.svg"
onTriggered: view.pageRotation -= 90
}
}
ToolButton {
action: Action {
shortcut: "Ctrl+R"
- icon.source: "resources/rotate-right.svg"
+ icon.source: "qrc:/pdfviewer/resources/rotate-right.svg"
onTriggered: view.pageRotation += 90
}
}
ToolButton {
action: Action {
- icon.source: "resources/go-previous-view-page.svg"
+ icon.source: "qrc:/pdfviewer/resources/go-previous-view-page.svg"
enabled: view.backEnbled
onTriggered: view.back()
}
@@ -152,7 +152,7 @@ ApplicationWindow {
}
ToolButton {
action: Action {
- icon.source: "resources/go-next-view-page.svg"
+ icon.source: "qrc:/pdfviewer/resources/go-next-view-page.svg"
enabled: view.forwardEnabled
onTriggered: view.forward()
}
@@ -163,14 +163,14 @@ ApplicationWindow {
ToolButton {
action: Action {
shortcut: StandardKey.SelectAll
- icon.source: "resources/edit-select-all.svg"
+ icon.source: "qrc:/pdfviewer/resources/edit-select-all.svg"
onTriggered: view.selectAll()
}
}
ToolButton {
action: Action {
shortcut: StandardKey.Copy
- icon.source: "resources/edit-copy.svg"
+ icon.source: "qrc:/pdfviewer/resources/edit-copy.svg"
enabled: view.selectedText !== ""
onTriggered: view.copySelectionToClipboard()
}
@@ -308,7 +308,7 @@ ApplicationWindow {
anchors.fill: parent
ToolButton {
action: Action {
- icon.source: "resources/go-up-search.svg"
+ icon.source: "qrc:/pdfviewer/resources/go-up-search.svg"
shortcut: StandardKey.FindPrevious
onTriggered: view.searchBack()
}
@@ -324,7 +324,7 @@ ApplicationWindow {
onAccepted: searchDrawer.open()
Image {
visible: searchField.text !== ""
- source: "resources/edit-clear.svg"
+ source: "qrc:/pdfviewer/resources/edit-clear.svg"
anchors {
right: parent.right
top: parent.top
@@ -339,7 +339,7 @@ ApplicationWindow {
}
ToolButton {
action: Action {
- icon.source: "resources/go-down-search.svg"
+ icon.source: "qrc:/pdfviewer/resources/go-down-search.svg"
shortcut: StandardKey.FindNext
onTriggered: view.searchForward()
}
diff --git a/examples/pdf/pdfviewer/CMakeLists.txt b/examples/pdf/pdfviewer/CMakeLists.txt
new file mode 100644
index 00000000..8265861d
--- /dev/null
+++ b/examples/pdf/pdfviewer/CMakeLists.txt
@@ -0,0 +1,62 @@
+cmake_minimum_required(VERSION 3.16)
+project(pdfviewer LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/pdf/pdfviewer")
+
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS 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"
+)
+
+qt6_add_resources(pdfviewerquick "viewer"
+ PREFIX
+ "/pdfviewer"
+ FILES
+ ${viewer_resource_files}
+)
+
+install(TARGETS pdfviewerquick
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/pdf/pdfviewer/viewer.qml b/examples/pdf/pdfviewer/viewer.qml
index 38d62740..8c85a09d 100644
--- a/examples/pdf/pdfviewer/viewer.qml
+++ b/examples/pdf/pdfviewer/viewer.qml
@@ -47,15 +47,15 @@
** $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
+import QtQml // workaround for QTBUG-82873
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Pdf
+import QtQuick.Shapes
+import QtQuick.Window
+import Qt.labs.animation
+import Qt.labs.platform as Platform
ApplicationWindow {
id: root
@@ -74,7 +74,7 @@ ApplicationWindow {
ToolButton {
action: Action {
shortcut: StandardKey.Open
- icon.source: "resources/document-open.svg"
+ icon.source: "qrc:/pdfviewer/resources/document-open.svg"
onTriggered: fileDialog.open()
}
}
@@ -82,7 +82,7 @@ ApplicationWindow {
action: Action {
shortcut: StandardKey.ZoomIn
enabled: view.sourceSize.width < 10000
- icon.source: "resources/zoom-in.svg"
+ icon.source: "qrc:/pdfviewer/resources/zoom-in.svg"
onTriggered: view.renderScale *= root.scaleStep
}
}
@@ -90,46 +90,46 @@ ApplicationWindow {
action: Action {
shortcut: StandardKey.ZoomOut
enabled: view.sourceSize.width > 50
- icon.source: "resources/zoom-out.svg"
+ icon.source: "qrc:/pdfviewer/resources/zoom-out.svg"
onTriggered: view.renderScale /= root.scaleStep
}
}
ToolButton {
action: Action {
- icon.source: "resources/zoom-fit-width.svg"
+ icon.source: "qrc:/pdfviewer/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:/pdfviewer/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:/pdfviewer/resources/zoom-original.svg"
onTriggered: view.resetScale()
}
}
ToolButton {
action: Action {
shortcut: "Ctrl+L"
- icon.source: "resources/rotate-left.svg"
+ icon.source: "qrc:/pdfviewer/resources/rotate-left.svg"
onTriggered: view.pageRotation -= 90
}
}
ToolButton {
action: Action {
shortcut: "Ctrl+R"
- icon.source: "resources/rotate-right.svg"
+ icon.source: "qrc:/pdfviewer/resources/rotate-right.svg"
onTriggered: view.pageRotation += 90
}
}
ToolButton {
action: Action {
- icon.source: "resources/go-previous-view-page.svg"
+ icon.source: "qrc:/pdfviewer/resources/go-previous-view-page.svg"
enabled: view.backEnabled
onTriggered: view.back()
}
@@ -155,7 +155,7 @@ ApplicationWindow {
}
ToolButton {
action: Action {
- icon.source: "resources/go-next-view-page.svg"
+ icon.source: "qrc:/pdfviewer/resources/go-next-view-page.svg"
enabled: view.forwardEnabled
onTriggered: view.forward()
}
@@ -166,14 +166,14 @@ ApplicationWindow {
ToolButton {
action: Action {
shortcut: StandardKey.SelectAll
- icon.source: "resources/edit-select-all.svg"
+ icon.source: "qrc:/pdfviewer/resources/edit-select-all.svg"
onTriggered: view.selectAll()
}
}
ToolButton {
action: Action {
shortcut: StandardKey.Copy
- icon.source: "resources/edit-copy.svg"
+ icon.source: "qrc:/pdfviewer/resources/edit-copy.svg"
enabled: view.selectedText !== ""
onTriggered: view.copySelectionToClipboard()
}
@@ -282,7 +282,7 @@ ApplicationWindow {
anchors.fill: parent
ToolButton {
action: Action {
- icon.source: "resources/go-up-search.svg"
+ icon.source: "qrc:/pdfviewer/resources/go-up-search.svg"
shortcut: StandardKey.FindPrevious
onTriggered: view.searchBack()
}
@@ -299,7 +299,7 @@ ApplicationWindow {
onAccepted: searchDrawer.open()
Image {
visible: searchField.text !== ""
- source: "resources/edit-clear.svg"
+ source: "qrc:/pdfviewer/resources/edit-clear.svg"
anchors {
right: parent.right
top: parent.top
@@ -314,7 +314,7 @@ ApplicationWindow {
}
ToolButton {
action: Action {
- icon.source: "resources/go-down-search.svg"
+ icon.source: "qrc:/pdfviewer/resources/go-down-search.svg"
shortcut: StandardKey.FindNext
onTriggered: view.searchForward()
}
diff --git a/examples/pdfwidgets/CMakeLists.txt b/examples/pdfwidgets/CMakeLists.txt
new file mode 100644
index 00000000..37496ebe
--- /dev/null
+++ b/examples/pdfwidgets/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(pdfviewer)
diff --git a/examples/pdfwidgets/pdfviewer/CMakeLists.txt b/examples/pdfwidgets/pdfviewer/CMakeLists.txt
new file mode 100644
index 00000000..a530b321
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Generated from pdfviewer.pro.
+
+cmake_minimum_required(VERSION 3.16)
+project(pdfviewer LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC 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 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+qt_add_executable(pdfviewerwidgets
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+ pageselector.cpp pageselector.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/busy.png"
+ "images/fileopen.png"
+ "images/go-next-24.png"
+ "images/go-previous-24.png"
+ "images/zoom-in-24.png"
+ "images/zoom-in-32.png"
+ "images/zoom-out-24.png"
+ "images/zoom-out-32.png"
+)
+
+qt6_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 a38d62e5..8024c0a5 100644
--- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
+++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
@@ -34,8 +34,8 @@
//! TODO add thumbnail \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 QPdfDocument class to render
+ PDF documents and the QPdfPageNavigation 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
@@ -83,7 +83,7 @@
\printuntil addWidget(m_pageSelector)
- We use the \l QPdfPageNavigation class to handle the navigation through a
+ We use the QPdfPageNavigation class to handle the navigation through a
PDF document:
\printuntil setPageNavigation
diff --git a/examples/webengine/CMakeLists.txt b/examples/webenginequick/CMakeLists.txt
index b08d0398..b08d0398 100644
--- a/examples/webengine/CMakeLists.txt
+++ b/examples/webenginequick/CMakeLists.txt
diff --git a/examples/webengine/customdialogs/CMakeLists.txt b/examples/webenginequick/customdialogs/CMakeLists.txt
index 93127f37..bd181093 100644
--- a/examples/webengine/customdialogs/CMakeLists.txt
+++ b/examples/webenginequick/customdialogs/CMakeLists.txt
@@ -11,7 +11,7 @@ if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webengine/customdialogs")
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/customdialogs")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
@@ -31,8 +31,6 @@ target_link_libraries(customdialogs PUBLIC
Qt::WebEngineQuick
)
-
-# Resources:
set(customdialogs_resource_files
"MessageRectangle.qml"
"SwitchButton.qml"
diff --git a/examples/webengine/customdialogs/MessageRectangle.qml b/examples/webenginequick/customdialogs/MessageRectangle.qml
index 880cf27d..880cf27d 100644
--- a/examples/webengine/customdialogs/MessageRectangle.qml
+++ b/examples/webenginequick/customdialogs/MessageRectangle.qml
diff --git a/examples/webengine/customdialogs/SwitchButton.qml b/examples/webenginequick/customdialogs/SwitchButton.qml
index 55005899..55005899 100644
--- a/examples/webengine/customdialogs/SwitchButton.qml
+++ b/examples/webenginequick/customdialogs/SwitchButton.qml
diff --git a/examples/webengine/customdialogs/WebView.qml b/examples/webenginequick/customdialogs/WebView.qml
index 5d388e46..61bbea87 100644
--- a/examples/webengine/customdialogs/WebView.qml
+++ b/examples/webenginequick/customdialogs/WebView.qml
@@ -52,7 +52,7 @@ import QtQuick
import QtWebEngine
WebEngineView {
-
+ id: view
url: "qrc:/index.html"
property bool useDefaultDialogs: true
signal openForm(var form)
@@ -115,9 +115,11 @@ WebEngineView {
}
onAuthenticationDialogRequested: function(request) {
- if (useDefaultDialogs)
+ 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}});
diff --git a/examples/webengine/customdialogs/customdialogs.pro b/examples/webenginequick/customdialogs/customdialogs.pro
index 8555318a..1b9a6778 100644
--- a/examples/webengine/customdialogs/customdialogs.pro
+++ b/examples/webenginequick/customdialogs/customdialogs.pro
@@ -10,7 +10,7 @@ SOURCES += \
RESOURCES += \
customdialogs.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/customdialogs
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/customdialogs
INSTALLS += target
qtHaveModule(widgets) {
diff --git a/examples/webengine/customdialogs/customdialogs.qrc b/examples/webenginequick/customdialogs/customdialogs.qrc
index bb267719..bb267719 100644
--- a/examples/webengine/customdialogs/customdialogs.qrc
+++ b/examples/webenginequick/customdialogs/customdialogs.qrc
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-auth1.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-auth1.png
index 042712f5..042712f5 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs-auth1.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-auth1.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-auth2.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-auth2.png
index 41828d36..41828d36 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs-auth2.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-auth2.png
Binary files differ
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-color1.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-color1.png
new file mode 100644
index 00000000..7f0492f8
--- /dev/null
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-color1.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-color2.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-color2.png
index 9087fdf1..9087fdf1 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs-color2.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-color2.png
Binary files differ
diff --git a/examples/webenginequick/customdialogs/doc/images/customdialogs-file1.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-file1.png
new file mode 100644
index 00000000..5023ced6
--- /dev/null
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-file1.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-file2.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-file2.png
index aa25579d..aa25579d 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs-file2.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-file2.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-menu.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-menu.png
index 3409c951..3409c951 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs-menu.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-menu.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-prompt1.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-prompt1.png
index c34080b4..c34080b4 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs-prompt1.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-prompt1.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-prompt2.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-prompt2.png
index 2c8d9264..2c8d9264 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs-prompt2.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-prompt2.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs-tooltip.png b/examples/webenginequick/customdialogs/doc/images/customdialogs-tooltip.png
index 498de959..498de959 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs-tooltip.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs-tooltip.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/images/customdialogs.png b/examples/webenginequick/customdialogs/doc/images/customdialogs.png
index c42114a1..c42114a1 100644
--- a/examples/webengine/customdialogs/doc/images/customdialogs.png
+++ b/examples/webenginequick/customdialogs/doc/images/customdialogs.png
Binary files differ
diff --git a/examples/webengine/customdialogs/doc/src/customdialogs.qdoc b/examples/webenginequick/customdialogs/doc/src/customdialogs.qdoc
index b7541745..2d7b9f19 100644
--- a/examples/webengine/customdialogs/doc/src/customdialogs.qdoc
+++ b/examples/webenginequick/customdialogs/doc/src/customdialogs.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example webengine/customdialogs
+ \example webenginequick/customdialogs
\title WebEngine Qt Quick Custom Dialogs Example
\ingroup webengine-examples
\brief Customizes UI elements of \QWE's dialogs.
@@ -74,7 +74,7 @@
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
+ \quotefromfile webenginequick/customdialogs/main.cpp
\skipto main
\printuntil }
@@ -84,7 +84,7 @@
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
+ \quotefromfile webenginequick/customdialogs/main.qml
\skipto Window
\printuntil Component
\printuntil }
@@ -110,7 +110,7 @@
\c onContextMenuRequested signal handler to handle requests for
\c #openMenu URL links:
- \quotefromfile webengine/customdialogs/WebView.qml
+ \quotefromfile webenginequick/customdialogs/WebView.qml
\skipto WebEngineView
\printuntil {
\dots 4
@@ -131,7 +131,7 @@
\image customdialogs-menu.png
- \quotefromfile webengine/customdialogs/forms/Menu.qml
+ \quotefromfile webenginequick/customdialogs/forms/Menu.qml
\skipto MenuForm
\printuntil }
\printuntil }
@@ -146,7 +146,7 @@
\c onTooltipRequested signal handler to handle requests for
custom tooltip menus at specific positions:
- \quotefromfile webengine/customdialogs/WebView.qml
+ \quotefromfile webenginequick/customdialogs/WebView.qml
\skipto WebEngineView
\printuntil {
\dots 4
@@ -167,7 +167,7 @@
\image customdialogs-tooltip.png
- \quotefromfile webengine/customdialogs/WebView.qml
+ \quotefromfile webenginequick/customdialogs/WebView.qml
\skipto Rectangle
\printuntil }
@@ -178,7 +178,7 @@
\l [QML]{AuthenticationDialogRequest} is a request object that is passed
as a parameter of the WebEngineView::authenticationDialogRequested signal:
- \quotefromfile webengine/customdialogs/WebView.qml
+ \quotefromfile webenginequick/customdialogs/WebView.qml
\skipto WebEngineView
\printuntil {
\dots 4
@@ -198,7 +198,7 @@
\image customdialogs-auth2.png
- \quotefromfile webengine/customdialogs/forms/Authentication.qml
+ \quotefromfile webenginequick/customdialogs/forms/Authentication.qml
\skipto AuthenticationForm
\printuntil }
\printuntil }
@@ -219,7 +219,7 @@
\l [QML]{JavaScriptDialogRequest} is a request object that is passed as a
parameter of the WebEngineView::javaScriptDialogRequested signal:
- \quotefromfile webengine/customdialogs/WebView.qml
+ \quotefromfile webenginequick/customdialogs/WebView.qml
\skipto WebEngineView
\printuntil {
\dots 4
@@ -239,7 +239,7 @@
\image customdialogs-prompt2.png
- \quotefromfile webengine/customdialogs/forms/JavaScript.qml
+ \quotefromfile webenginequick/customdialogs/forms/JavaScript.qml
\skipto JavaScriptForm
\printuntil }
\printuntil }
@@ -253,12 +253,12 @@
\section2 Color Dialog Requests
- Currently, Qt WebEngine does not provide Color Dialog, a custom dialog should be implemented.
+ \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
+ \quotefromfile webenginequick/customdialogs/WebView.qml
\skipto WebEngineView
\printuntil {
\dots 4
@@ -273,12 +273,12 @@
\printline }
We use the \c onColorDialogRequested signal handler to check whether
- we should use the default color picker dialog (which currently is not provided).
- If not, we accept the request and switch the view to show the \c ColorPickerForm:
+ 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
+ \quotefromfile webenginequick/customdialogs/forms/ColorPicker.qml
\skipto ColorPickerForm
\printuntil }
\printuntil }
@@ -294,12 +294,12 @@
\section2 File Dialog Requests
- Currently, Qt WebEngine does not provide File Dialog, a custom dialog should be implemented.
+ \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
+ \quotefromfile webenginequick/customdialogs/WebView.qml
\skipto WebEngineView
\printuntil {
\dots 4
@@ -309,12 +309,12 @@
\printuntil }
We use the \c onFileDialogRequested signal handler to check whether
- we should use the default file picker dialog (which currently is not provided).
- If not, we accept the request and switch the view to show the \c FilePickerForm:
+ we should use the default file 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
+ \quotefromfile webenginequick/customdialogs/forms/FilePicker.qml
\skipto FilePickerForm
\printuntil }
\printuntil }
diff --git a/examples/webengine/customdialogs/forms/Authentication.qml b/examples/webenginequick/customdialogs/forms/Authentication.qml
index 6365db9c..6365db9c 100644
--- a/examples/webengine/customdialogs/forms/Authentication.qml
+++ b/examples/webenginequick/customdialogs/forms/Authentication.qml
diff --git a/examples/webengine/customdialogs/forms/AuthenticationForm.ui.qml b/examples/webenginequick/customdialogs/forms/AuthenticationForm.ui.qml
index ab334aae..ab334aae 100644
--- a/examples/webengine/customdialogs/forms/AuthenticationForm.ui.qml
+++ b/examples/webenginequick/customdialogs/forms/AuthenticationForm.ui.qml
diff --git a/examples/webengine/customdialogs/forms/ColorCell.qml b/examples/webenginequick/customdialogs/forms/ColorCell.qml
index 495a2900..495a2900 100644
--- a/examples/webengine/customdialogs/forms/ColorCell.qml
+++ b/examples/webenginequick/customdialogs/forms/ColorCell.qml
diff --git a/examples/webengine/customdialogs/forms/ColorPicker.qml b/examples/webenginequick/customdialogs/forms/ColorPicker.qml
index 7c1545c4..7c1545c4 100644
--- a/examples/webengine/customdialogs/forms/ColorPicker.qml
+++ b/examples/webenginequick/customdialogs/forms/ColorPicker.qml
diff --git a/examples/webengine/customdialogs/forms/ColorPickerForm.ui.qml b/examples/webenginequick/customdialogs/forms/ColorPickerForm.ui.qml
index c2de234e..c2de234e 100644
--- a/examples/webengine/customdialogs/forms/ColorPickerForm.ui.qml
+++ b/examples/webenginequick/customdialogs/forms/ColorPickerForm.ui.qml
diff --git a/examples/webengine/customdialogs/forms/CustomButton.qml b/examples/webenginequick/customdialogs/forms/CustomButton.qml
index 3ab90a75..3ab90a75 100644
--- a/examples/webengine/customdialogs/forms/CustomButton.qml
+++ b/examples/webenginequick/customdialogs/forms/CustomButton.qml
diff --git a/examples/webengine/customdialogs/forms/FilePicker.qml b/examples/webenginequick/customdialogs/forms/FilePicker.qml
index 97acda32..97acda32 100644
--- a/examples/webengine/customdialogs/forms/FilePicker.qml
+++ b/examples/webenginequick/customdialogs/forms/FilePicker.qml
diff --git a/examples/webengine/customdialogs/forms/FilePickerForm.ui.qml b/examples/webenginequick/customdialogs/forms/FilePickerForm.ui.qml
index 8a230c98..8a230c98 100644
--- a/examples/webengine/customdialogs/forms/FilePickerForm.ui.qml
+++ b/examples/webenginequick/customdialogs/forms/FilePickerForm.ui.qml
diff --git a/examples/webengine/customdialogs/forms/FileRow.qml b/examples/webenginequick/customdialogs/forms/FileRow.qml
index 0356dcea..0356dcea 100644
--- a/examples/webengine/customdialogs/forms/FileRow.qml
+++ b/examples/webenginequick/customdialogs/forms/FileRow.qml
diff --git a/examples/webengine/customdialogs/forms/JavaScript.qml b/examples/webenginequick/customdialogs/forms/JavaScript.qml
index 61e009e5..61e009e5 100644
--- a/examples/webengine/customdialogs/forms/JavaScript.qml
+++ b/examples/webenginequick/customdialogs/forms/JavaScript.qml
diff --git a/examples/webengine/customdialogs/forms/JavaScriptForm.ui.qml b/examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml
index 14d9dc30..14d9dc30 100644
--- a/examples/webengine/customdialogs/forms/JavaScriptForm.ui.qml
+++ b/examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml
diff --git a/examples/webengine/customdialogs/forms/Menu.qml b/examples/webenginequick/customdialogs/forms/Menu.qml
index 4f7f9f9e..4f7f9f9e 100644
--- a/examples/webengine/customdialogs/forms/Menu.qml
+++ b/examples/webenginequick/customdialogs/forms/Menu.qml
diff --git a/examples/webengine/customdialogs/forms/MenuForm.ui.qml b/examples/webenginequick/customdialogs/forms/MenuForm.ui.qml
index cba7a1b3..cba7a1b3 100644
--- a/examples/webengine/customdialogs/forms/MenuForm.ui.qml
+++ b/examples/webenginequick/customdialogs/forms/MenuForm.ui.qml
diff --git a/examples/webengine/customdialogs/icon.svg b/examples/webenginequick/customdialogs/icon.svg
index 48271180..48271180 100644
--- a/examples/webengine/customdialogs/icon.svg
+++ b/examples/webenginequick/customdialogs/icon.svg
diff --git a/examples/webengine/customdialogs/index.html b/examples/webenginequick/customdialogs/index.html
index 69c0e6b2..e9fb5622 100644
--- a/examples/webengine/customdialogs/index.html
+++ b/examples/webenginequick/customdialogs/index.html
@@ -18,7 +18,7 @@
Open Authentication Dialog</button></td>
</tr>
<tr>
- <td><button class="button" onclick="window.location = 'http://localhost.:5555/OPEN_PROXY'">
+ <td><button class="button" onclick="window.location = 'http://www.qt.io'">
Open Proxy Dialog</button></td>
</tr>
<tr>
diff --git a/examples/webengine/customdialogs/main.cpp b/examples/webenginequick/customdialogs/main.cpp
index 463da44f..6ed5771f 100644
--- a/examples/webengine/customdialogs/main.cpp
+++ b/examples/webenginequick/customdialogs/main.cpp
@@ -53,22 +53,14 @@
#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");
QtWebEngineQuick::initialize();
- Application app(argc, argv);
+ QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
Server *server = new Server(&engine);
diff --git a/examples/webengine/customdialogs/main.qml b/examples/webenginequick/customdialogs/main.qml
index a5ff925b..529737e9 100644
--- a/examples/webengine/customdialogs/main.qml
+++ b/examples/webenginequick/customdialogs/main.qml
@@ -55,8 +55,8 @@ import QtQuick.Window
Window {
id: mainWindow
- width: 350
- height: 550
+ width: 800
+ height: 600
visible: true
StackView {
@@ -85,6 +85,8 @@ Window {
function closeForm()
{
pop(main);
+ // reset url in case of proxy error
+ webView.url = "qrc:/index.html"
}
function openForm(form)
diff --git a/examples/webengine/customdialogs/server.cpp b/examples/webenginequick/customdialogs/server.cpp
index 39520e3b..9b05d3a1 100644
--- a/examples/webengine/customdialogs/server.cpp
+++ b/examples/webenginequick/customdialogs/server.cpp
@@ -75,11 +75,20 @@ void Server::handleReadReady()
{
QTcpSocket *socket = qobject_cast<QTcpSocket*>(sender());
Q_ASSERT(socket);
- QByteArray msg = socket->readAll();
- if (msg.contains(QByteArrayLiteral("OPEN_AUTH")))
+ 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");
- 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");
+ 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/examples/webengine/customdialogs/server.h b/examples/webenginequick/customdialogs/server.h
index 501aef53..0a495cc4 100644
--- a/examples/webengine/customdialogs/server.h
+++ b/examples/webenginequick/customdialogs/server.h
@@ -70,6 +70,7 @@ private slots:
private:
QTcpServer m_server;
+ QByteArray m_data;
};
#endif // SERVER_H
diff --git a/examples/webengine/customdialogs/style.css b/examples/webenginequick/customdialogs/style.css
index e4c25e7e..e4c25e7e 100644
--- a/examples/webengine/customdialogs/style.css
+++ b/examples/webenginequick/customdialogs/style.css
diff --git a/examples/webengine/lifecycle/CMakeLists.txt b/examples/webenginequick/lifecycle/CMakeLists.txt
index 56cb56e2..2d7b3e26 100644
--- a/examples/webengine/lifecycle/CMakeLists.txt
+++ b/examples/webenginequick/lifecycle/CMakeLists.txt
@@ -11,7 +11,7 @@ if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webengine/lifecycle")
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/lifecycle")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
diff --git a/examples/webengine/lifecycle/WebBrowser.qml b/examples/webenginequick/lifecycle/WebBrowser.qml
index e29ac4f9..e29ac4f9 100644
--- a/examples/webengine/lifecycle/WebBrowser.qml
+++ b/examples/webenginequick/lifecycle/WebBrowser.qml
diff --git a/examples/webengine/lifecycle/WebTab.qml b/examples/webenginequick/lifecycle/WebTab.qml
index f83ce940..f83ce940 100644
--- a/examples/webengine/lifecycle/WebTab.qml
+++ b/examples/webenginequick/lifecycle/WebTab.qml
diff --git a/examples/webengine/lifecycle/WebTabBar.qml b/examples/webenginequick/lifecycle/WebTabBar.qml
index b883cfc3..b883cfc3 100644
--- a/examples/webengine/lifecycle/WebTabBar.qml
+++ b/examples/webenginequick/lifecycle/WebTabBar.qml
diff --git a/examples/webengine/lifecycle/WebTabButton.qml b/examples/webenginequick/lifecycle/WebTabButton.qml
index 50bc463d..50bc463d 100644
--- a/examples/webengine/lifecycle/WebTabButton.qml
+++ b/examples/webenginequick/lifecycle/WebTabButton.qml
diff --git a/examples/webengine/lifecycle/WebTabStack.qml b/examples/webenginequick/lifecycle/WebTabStack.qml
index 6ceedb8a..6ceedb8a 100644
--- a/examples/webengine/lifecycle/WebTabStack.qml
+++ b/examples/webenginequick/lifecycle/WebTabStack.qml
diff --git a/examples/webengine/lifecycle/WebToolButton.qml b/examples/webenginequick/lifecycle/WebToolButton.qml
index 9565dfb1..9565dfb1 100644
--- a/examples/webengine/lifecycle/WebToolButton.qml
+++ b/examples/webenginequick/lifecycle/WebToolButton.qml
diff --git a/examples/webengine/lifecycle/doc/images/lifecycle-automatic.png b/examples/webenginequick/lifecycle/doc/images/lifecycle-automatic.png
index 2c62967a..2c62967a 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 7fb5c5a8..7fb5c5a8 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 87b71902..87b71902 100644
--- a/examples/webengine/lifecycle/doc/images/lifecycle.png
+++ b/examples/webenginequick/lifecycle/doc/images/lifecycle.png
Binary files differ
diff --git a/examples/webengine/lifecycle/doc/src/lifecycle.qdoc b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
index d10e617e..80faf8b1 100644
--- a/examples/webengine/lifecycle/doc/src/lifecycle.qdoc
+++ b/examples/webenginequick/lifecycle/doc/src/lifecycle.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example webengine/lifecycle
+ \example webenginequick/lifecycle
\title WebEngine Lifecycle Example
\ingroup webengine-examples
\brief Freezes and discards background tabs to reduce CPU and memory usage.
diff --git a/examples/webengine/lifecycle/lifecycle.pro b/examples/webenginequick/lifecycle/lifecycle.pro
index 6e807eb3..ccbe801f 100644
--- a/examples/webengine/lifecycle/lifecycle.pro
+++ b/examples/webenginequick/lifecycle/lifecycle.pro
@@ -6,5 +6,5 @@ SOURCES += main.cpp
RESOURCES += resources.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/lifecycle
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/lifecycle
INSTALLS += target
diff --git a/examples/webengine/lifecycle/main.cpp b/examples/webenginequick/lifecycle/main.cpp
index 1e2a4867..1e2a4867 100644
--- a/examples/webengine/lifecycle/main.cpp
+++ b/examples/webenginequick/lifecycle/main.cpp
diff --git a/examples/webengine/lifecycle/qtquickcontrols2.conf b/examples/webenginequick/lifecycle/qtquickcontrols2.conf
index 68c77cec..68c77cec 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 41e5092c..41e5092c 100644
--- a/examples/webengine/lifecycle/resources.qrc
+++ b/examples/webenginequick/lifecycle/resources.qrc
diff --git a/examples/webengine/minimal/CMakeLists.txt b/examples/webenginequick/minimal/CMakeLists.txt
index 2972fc63..34276e8b 100644
--- a/examples/webengine/minimal/CMakeLists.txt
+++ b/examples/webenginequick/minimal/CMakeLists.txt
@@ -11,20 +11,20 @@ if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webengine/minimal-qml")
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/minimal-qml")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS WebEngineQuick)
-qt_add_executable(minimal-qml
+qt_add_executable(webengine-minimal-qml
main.cpp
)
-set_target_properties(minimal-qml PROPERTIES
+set_target_properties(webengine-minimal-qml PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(minimal-qml PUBLIC
+target_link_libraries(webengine-minimal-qml PUBLIC
Qt::Core
Qt::Gui
Qt::WebEngineQuick
@@ -36,14 +36,14 @@ set(qml_resource_files
"main.qml"
)
-qt6_add_resources(minimal-qml "qml"
+qt6_add_resources(webengine-minimal-qml "qml"
PREFIX
"/"
FILES
${qml_resource_files}
)
-install(TARGETS minimal-qml
+install(TARGETS webengine-minimal-qml
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/webengine/minimal/doc/src/minimal.qdoc b/examples/webenginequick/minimal/doc/src/minimal.qdoc
index f63d15c8..c4b3afef 100644
--- a/examples/webengine/minimal/doc/src/minimal.qdoc
+++ b/examples/webenginequick/minimal/doc/src/minimal.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example webengine/minimal
+ \example webenginequick/minimal
\title WebEngine Qt Quick Minimal Example
\ingroup webengine-examples
\brief Displays a web page using the Qt Quick integration of \QWE.
@@ -46,7 +46,7 @@
classes. We also include \c qtwebengineglobal.h to be able to use
\l{QtWebEngineQuick::initialize}.
- \quotefromfile webengine/minimal/main.cpp
+ \quotefromfile webenginequick/minimal/main.cpp
\skipto #include
\printto main
@@ -74,7 +74,7 @@
and make it visible. The window will be filled by a WebEngineView item
loading the \l{Qt Homepage}.
- \quotefromfile webengine/minimal/main.qml
+ \quotefromfile webenginequick/minimal/main.qml
\skipto import
\printuntil }
\printline }
diff --git a/examples/webengine/minimal/main.cpp b/examples/webenginequick/minimal/main.cpp
index cf11eea2..cf11eea2 100644
--- a/examples/webengine/minimal/main.cpp
+++ b/examples/webenginequick/minimal/main.cpp
diff --git a/examples/webengine/minimal/main.qml b/examples/webenginequick/minimal/main.qml
index d3217666..d3217666 100644
--- a/examples/webengine/minimal/main.qml
+++ b/examples/webenginequick/minimal/main.qml
diff --git a/examples/webengine/minimal/minimal.pro b/examples/webenginequick/minimal/minimal.pro
index 9ec75318..acca6477 100644
--- a/examples/webengine/minimal/minimal.pro
+++ b/examples/webenginequick/minimal/minimal.pro
@@ -6,5 +6,5 @@ SOURCES += main.cpp
RESOURCES += qml.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/minimal
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/minimal
INSTALLS += target
diff --git a/examples/webengine/minimal/qml.qrc b/examples/webenginequick/minimal/qml.qrc
index 0ff3892d..0ff3892d 100644
--- a/examples/webengine/minimal/qml.qrc
+++ b/examples/webenginequick/minimal/qml.qrc
diff --git a/examples/webengine/quicknanobrowser/ApplicationRoot.qml b/examples/webenginequick/quicknanobrowser/ApplicationRoot.qml
index cd40a7fd..cd40a7fd 100644
--- a/examples/webengine/quicknanobrowser/ApplicationRoot.qml
+++ b/examples/webenginequick/quicknanobrowser/ApplicationRoot.qml
diff --git a/examples/webengine/quicknanobrowser/BrowserDialog.qml b/examples/webenginequick/quicknanobrowser/BrowserDialog.qml
index 281f4490..281f4490 100644
--- a/examples/webengine/quicknanobrowser/BrowserDialog.qml
+++ b/examples/webenginequick/quicknanobrowser/BrowserDialog.qml
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
index 32955e14..0da1bc04 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml
@@ -571,21 +571,21 @@ ApplicationWindow {
sslDialog.enqueue(error);
}
- onNewViewRequested: function(request) {
+ onNewWindowRequested: function(request) {
if (!request.userInitiated)
console.warn("Blocked a popup window.");
- else if (request.destination === WebEngineNewViewRequest.InNewTab) {
+ else if (request.destination === WebEngineNewWindowRequest.InNewTab) {
var tab = tabBar.createTab(currentWebView.profile, true, request.requestedUrl);
- tab.acceptAsNewView(request);
- } else if (request.destination === WebEngineNewViewRequest.InNewBackgroundTab) {
+ tab.acceptAsNewWindow(request);
+ } else if (request.destination === WebEngineNewWindowRequest.InNewBackgroundTab) {
var backgroundTab = tabBar.createTab(currentWebView.profile, false);
- backgroundTab.acceptAsNewView(request);
- } else if (request.destination === WebEngineNewViewRequest.InNewDialog) {
+ backgroundTab.acceptAsNewWindow(request);
+ } else if (request.destination === WebEngineNewWindowRequest.InNewDialog) {
var dialog = applicationRoot.createDialog(currentWebView.profile);
- dialog.currentWebView.acceptAsNewView(request);
+ dialog.currentWebView.acceptAsNewWindow(request);
} else {
var window = applicationRoot.createWindow(currentWebView.profile);
- window.currentWebView.acceptAsNewView(request);
+ window.currentWebView.acceptAsNewWindow(request);
}
}
@@ -672,7 +672,7 @@ ApplicationWindow {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
- onNewViewRequested: function(request) {
+ onNewWindowRequested: function(request) {
var tab = tabBar.createTab(currentWebView.profile);
request.openIn(tab);
}
diff --git a/examples/webengine/quicknanobrowser/CMakeLists.txt b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
index 1884cc8d..a9e8bb4a 100644
--- a/examples/webengine/quicknanobrowser/CMakeLists.txt
+++ b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
@@ -11,7 +11,7 @@ if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webengine/quicknanobrowser")
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/quicknanobrowser")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
diff --git a/examples/webengine/quicknanobrowser/DownloadView.qml b/examples/webenginequick/quicknanobrowser/DownloadView.qml
index ea7e0b53..ea7e0b53 100644
--- a/examples/webengine/quicknanobrowser/DownloadView.qml
+++ b/examples/webenginequick/quicknanobrowser/DownloadView.qml
diff --git a/examples/webengine/quicknanobrowser/FindBar.qml b/examples/webenginequick/quicknanobrowser/FindBar.qml
index 738a38c8..738a38c8 100644
--- a/examples/webengine/quicknanobrowser/FindBar.qml
+++ b/examples/webenginequick/quicknanobrowser/FindBar.qml
diff --git a/examples/webengine/quicknanobrowser/FullScreenNotification.qml b/examples/webenginequick/quicknanobrowser/FullScreenNotification.qml
index c5f891db..c5f891db 100644
--- a/examples/webengine/quicknanobrowser/FullScreenNotification.qml
+++ b/examples/webenginequick/quicknanobrowser/FullScreenNotification.qml
diff --git a/examples/webengine/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg b/examples/webenginequick/quicknanobrowser/doc/images/quicknanobrowser-demo.jpg
index 12693bb0..12693bb0 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/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
index 3188bb29..3b9af68b 100644
--- a/examples/webengine/quicknanobrowser/doc/src/quicknanobrowser.qdoc
+++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example webengine/quicknanobrowser
+ \example webenginequick/quicknanobrowser
\title WebEngine Quick Nano Browser
\ingroup webengine-examples
\brief A web browser implemented using the WebEngineView QML type.
@@ -55,26 +55,29 @@
We create the main window in the \e BrowserWindow.qml file using the ApplicationWindow type:
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
+ \quotefromfile webenginequick/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:
+ 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 TabView
- \printuntil Component.onCompleted
+ \skipto TabBar {
+ \printuntil return webview
+ \printuntil }
The tab contains a web engine view that loads web content:
- \printuntil focus
+ \skipto Component {
+ \printuntil currentWebView.reload
+ \printuntil /^\ {8}\}/
We use the \l Action type to create new tabs:
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
\skipto reload
\skipto Action
\printuntil }
@@ -82,14 +85,15 @@
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
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
+ \skipto menuBar: ToolBar
\printuntil anchors.fill
\dots
\skipto TextField
\printuntil addressBar
\dots
\skipto focus
- \printuntil /^\ {16}\}/
+ \printuntil /^\ {12}\}/
\section1 Handling Certificate Errors
@@ -97,18 +101,18 @@
\l{WebEngineCertificateError::}{defer()} QML method to pause the URL request and wait for user
input:
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
\skipto onCertificateError
\printuntil }
- We use the MessageDialog type to prompt users to continue or cancel the loading of the web page.
+ 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::}{ignoreCertificateError()} method to ignore the error and
- continue loading content from the URL. If users select \uicontrol No, 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 MessageDialog
+ \skipto Dialog {
\printuntil /^\ {4}\}/
\section1 Entering and Leaving Fullscreen Mode
@@ -119,7 +123,7 @@
The methdod sets the \l{WebEngineView::}{isFullScreen} property to be equal to the
\l{FullScreenRequest::}{toggleOn} property.
- \quotefromfile webengine/quicknanobrowser/BrowserWindow.qml
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
\skipto onFullScreenRequested
\printuntil /^\ {16}\}/
@@ -129,7 +133,7 @@
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
+ \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml
\skipto Settings
\printuntil appSettings
\skipto fullScreenSupportEnabled
diff --git a/examples/webengine/quicknanobrowser/icons/3rdparty/COPYING b/examples/webenginequick/quicknanobrowser/icons/3rdparty/COPYING
index 220881da..220881da 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 6f3f65d3..6f3f65d3 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 93be3d1e..93be3d1e 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 b68290bf..b68290bf 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/webengine/quicknanobrowser/icons/3rdparty/qt_attribution.json b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
index 4e5a4444..681223b1 100644
--- a/examples/webengine/quicknanobrowser/icons/3rdparty/qt_attribution.json
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
@@ -9,7 +9,7 @@
"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>
diff --git a/examples/webengine/quicknanobrowser/icons/3rdparty/view-refresh.png b/examples/webenginequick/quicknanobrowser/icons/3rdparty/view-refresh.png
index cab4d02c..cab4d02c 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/webengine/quicknanobrowser/main.cpp b/examples/webenginequick/quicknanobrowser/main.cpp
index 859856d9..f21b0362 100644
--- a/examples/webengine/quicknanobrowser/main.cpp
+++ b/examples/webenginequick/quicknanobrowser/main.cpp
@@ -50,13 +50,7 @@
#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 <QtWebEngineQuick/qtwebenginequickglobal.h>
@@ -81,7 +75,7 @@ int main(int argc, char **argv)
QCoreApplication::setOrganizationName("QtExamples");
QtWebEngineQuick::initialize();
- Application app(argc, argv);
+ QGuiApplication app(argc, argv);
QQmlApplicationEngine appEngine;
Utils utils;
diff --git a/examples/webengine/quicknanobrowser/quicknanobrowser.pro b/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
index 6217f2ef..8208e446 100644
--- a/examples/webengine/quicknanobrowser/quicknanobrowser.pro
+++ b/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
@@ -21,5 +21,5 @@ qtHaveModule(widgets) {
QT += widgets # QApplication is required to get native styling with QtQuickControls
}
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/quicknanobrowser
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/quicknanobrowser
INSTALLS += target
diff --git a/examples/webengine/quicknanobrowser/resources.qrc b/examples/webenginequick/quicknanobrowser/resources.qrc
index 9d1f927d..9d1f927d 100644
--- a/examples/webengine/quicknanobrowser/resources.qrc
+++ b/examples/webenginequick/quicknanobrowser/resources.qrc
diff --git a/examples/webengine/quicknanobrowser/utils.h b/examples/webenginequick/quicknanobrowser/utils.h
index 79aa38cc..79aa38cc 100644
--- a/examples/webengine/quicknanobrowser/utils.h
+++ b/examples/webenginequick/quicknanobrowser/utils.h
diff --git a/examples/webengine/recipebrowser/CMakeLists.txt b/examples/webenginequick/recipebrowser/CMakeLists.txt
index 8af1aa34..bb768a47 100644
--- a/examples/webengine/recipebrowser/CMakeLists.txt
+++ b/examples/webenginequick/recipebrowser/CMakeLists.txt
@@ -11,7 +11,7 @@ if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webengine/recipebrowser")
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/recipebrowser")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
diff --git a/examples/webengine/recipebrowser/doc/images/recipebrowser-demo.jpg b/examples/webenginequick/recipebrowser/doc/images/recipebrowser-demo.jpg
index 761ad357..761ad357 100644
--- a/examples/webengine/recipebrowser/doc/images/recipebrowser-demo.jpg
+++ b/examples/webenginequick/recipebrowser/doc/images/recipebrowser-demo.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc
index e777c612..42c1ce64 100644
--- a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example webengine/recipebrowser
+ \example webenginequick/recipebrowser
\title WebEngine Recipe Browser
\ingroup webengine-examples
\brief A small hybrid application based on the WebEngineView QML type and Qt Quick Controls 2.
@@ -52,7 +52,7 @@
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
+ \quotefromfile webenginequick/recipebrowser/main.cpp
\skipto #include
\printuntil }
@@ -65,7 +65,7 @@
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
+ \quotefromfile webenginequick/recipebrowser/resources/qml/main.qml
\skipto ApplicationWindow
\printuntil minimumHeight
@@ -92,7 +92,7 @@
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
+ \quotefromfile webenginequick/recipebrowser/resources/qml/main.qml
\skipto RecipeList
\printuntil }
@@ -125,7 +125,7 @@
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
+ \quotefromfile webenginequick/recipebrowser/resources/qml/main.qml
\skipto Timer {
\printuntil }
@@ -134,7 +134,7 @@
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
+ \quotefromfile webenginequick/recipebrowser/resources/qml/RecipeList.qml
\skipto FocusScope
\printuntil recipeSelected
@@ -215,7 +215,7 @@
The images on the pages are loaded from the compiled resource file.
- \quotefromfile webengine/recipebrowser/resources/pages/soup.html
+ \quotefromfile webenginequick/recipebrowser/resources/pages/soup.html
\printuntil </html>
\section1 Files and Attributions
diff --git a/examples/webengine/recipebrowser/main.cpp b/examples/webenginequick/recipebrowser/main.cpp
index 5e9281ce..5e9281ce 100644
--- a/examples/webengine/recipebrowser/main.cpp
+++ b/examples/webenginequick/recipebrowser/main.cpp
diff --git a/examples/webengine/recipebrowser/recipebrowser.pro b/examples/webenginequick/recipebrowser/recipebrowser.pro
index 3926a136..e358d00a 100644
--- a/examples/webengine/recipebrowser/recipebrowser.pro
+++ b/examples/webenginequick/recipebrowser/recipebrowser.pro
@@ -17,5 +17,5 @@ DISTFILES += \
resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt \
resources/pages/assets/3rdparty/MARKED-LICENSE.txt
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/recipebrowser
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/recipebrowser
INSTALLS += target
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt
index 23c52cc4..23c52cc4 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt
+++ b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKDOWN-LICENSE.txt
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt
index 8e3ba0e0..8e3ba0e0 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt
+++ b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/MARKED-LICENSE.txt
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/markdown.css b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/markdown.css
index 24fc2ffe..24fc2ffe 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/markdown.css
+++ b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/markdown.css
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.js b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/marked.js
index 33c02d9c..33c02d9c 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.js
+++ b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/marked.js
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
index a6c68f46..a6c68f46 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
+++ b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/custom.css b/examples/webenginequick/recipebrowser/resources/pages/assets/custom.css
index 6089ae58..6089ae58 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/custom.css
+++ b/examples/webenginequick/recipebrowser/resources/pages/assets/custom.css
diff --git a/examples/webengine/recipebrowser/resources/pages/assets/custom.js b/examples/webenginequick/recipebrowser/resources/pages/assets/custom.js
index 25bdf851..25bdf851 100644
--- a/examples/webengine/recipebrowser/resources/pages/assets/custom.js
+++ b/examples/webenginequick/recipebrowser/resources/pages/assets/custom.js
diff --git a/examples/webengine/recipebrowser/resources/pages/burger.html b/examples/webenginequick/recipebrowser/resources/pages/burger.html
index 6651cc0f..6651cc0f 100644
--- a/examples/webengine/recipebrowser/resources/pages/burger.html
+++ b/examples/webenginequick/recipebrowser/resources/pages/burger.html
diff --git a/examples/webengine/recipebrowser/resources/pages/cupcakes.html b/examples/webenginequick/recipebrowser/resources/pages/cupcakes.html
index 4791c7ff..4791c7ff 100644
--- a/examples/webengine/recipebrowser/resources/pages/cupcakes.html
+++ b/examples/webenginequick/recipebrowser/resources/pages/cupcakes.html
diff --git a/examples/webengine/recipebrowser/resources/pages/images/burger.jpg b/examples/webenginequick/recipebrowser/resources/pages/images/burger.jpg
index edc0c65d..edc0c65d 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/burger.jpg
+++ b/examples/webenginequick/recipebrowser/resources/pages/images/burger.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/cupcakes.jpg b/examples/webenginequick/recipebrowser/resources/pages/images/cupcakes.jpg
index cce52ba2..cce52ba2 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/cupcakes.jpg
+++ b/examples/webenginequick/recipebrowser/resources/pages/images/cupcakes.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/pasta.jpg b/examples/webenginequick/recipebrowser/resources/pages/images/pasta.jpg
index 7ac924b7..7ac924b7 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/pasta.jpg
+++ b/examples/webenginequick/recipebrowser/resources/pages/images/pasta.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/pizza.jpg b/examples/webenginequick/recipebrowser/resources/pages/images/pizza.jpg
index 8d8f756a..8d8f756a 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/pizza.jpg
+++ b/examples/webenginequick/recipebrowser/resources/pages/images/pizza.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/skewers.jpg b/examples/webenginequick/recipebrowser/resources/pages/images/skewers.jpg
index 6bb2f117..6bb2f117 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/skewers.jpg
+++ b/examples/webenginequick/recipebrowser/resources/pages/images/skewers.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/soup.jpg b/examples/webenginequick/recipebrowser/resources/pages/images/soup.jpg
index fc9dff90..fc9dff90 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/soup.jpg
+++ b/examples/webenginequick/recipebrowser/resources/pages/images/soup.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/images/steak.jpg b/examples/webenginequick/recipebrowser/resources/pages/images/steak.jpg
index 240b72eb..240b72eb 100644
--- a/examples/webengine/recipebrowser/resources/pages/images/steak.jpg
+++ b/examples/webenginequick/recipebrowser/resources/pages/images/steak.jpg
Binary files differ
diff --git a/examples/webengine/recipebrowser/resources/pages/pasta.html b/examples/webenginequick/recipebrowser/resources/pages/pasta.html
index 41ed1a75..41ed1a75 100644
--- a/examples/webengine/recipebrowser/resources/pages/pasta.html
+++ b/examples/webenginequick/recipebrowser/resources/pages/pasta.html
diff --git a/examples/webengine/recipebrowser/resources/pages/pizza.html b/examples/webenginequick/recipebrowser/resources/pages/pizza.html
index 348d809e..348d809e 100644
--- a/examples/webengine/recipebrowser/resources/pages/pizza.html
+++ b/examples/webenginequick/recipebrowser/resources/pages/pizza.html
diff --git a/examples/webengine/recipebrowser/resources/pages/skewers.html b/examples/webenginequick/recipebrowser/resources/pages/skewers.html
index aca4c485..aca4c485 100644
--- a/examples/webengine/recipebrowser/resources/pages/skewers.html
+++ b/examples/webenginequick/recipebrowser/resources/pages/skewers.html
diff --git a/examples/webengine/recipebrowser/resources/pages/soup.html b/examples/webenginequick/recipebrowser/resources/pages/soup.html
index 1b7027e5..1b7027e5 100644
--- a/examples/webengine/recipebrowser/resources/pages/soup.html
+++ b/examples/webenginequick/recipebrowser/resources/pages/soup.html
diff --git a/examples/webengine/recipebrowser/resources/pages/steak.html b/examples/webenginequick/recipebrowser/resources/pages/steak.html
index a56313e2..a56313e2 100644
--- a/examples/webengine/recipebrowser/resources/pages/steak.html
+++ b/examples/webenginequick/recipebrowser/resources/pages/steak.html
diff --git a/examples/webengine/recipebrowser/resources/qml/RecipeList.qml b/examples/webenginequick/recipebrowser/resources/qml/RecipeList.qml
index e4ec684a..e4ec684a 100644
--- a/examples/webengine/recipebrowser/resources/qml/RecipeList.qml
+++ b/examples/webenginequick/recipebrowser/resources/qml/RecipeList.qml
diff --git a/examples/webengine/recipebrowser/resources/qml/main.qml b/examples/webenginequick/recipebrowser/resources/qml/main.qml
index 927b4424..927b4424 100644
--- a/examples/webengine/recipebrowser/resources/qml/main.qml
+++ b/examples/webenginequick/recipebrowser/resources/qml/main.qml
diff --git a/examples/webengine/recipebrowser/resources/resources.qrc b/examples/webenginequick/recipebrowser/resources/resources.qrc
index bd13dcfa..bd13dcfa 100644
--- a/examples/webengine/recipebrowser/resources/resources.qrc
+++ b/examples/webenginequick/recipebrowser/resources/resources.qrc
diff --git a/examples/webengine/webengineaction/CMakeLists.txt b/examples/webenginequick/webengineaction/CMakeLists.txt
index 6a7a1233..a7bbf1ed 100644
--- a/examples/webengine/webengineaction/CMakeLists.txt
+++ b/examples/webenginequick/webengineaction/CMakeLists.txt
@@ -11,7 +11,7 @@ if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webengine/webengineaction")
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/webengineaction")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
diff --git a/examples/webengine/webengineaction/doc/images/webengineaction-example.png b/examples/webenginequick/webengineaction/doc/images/webengineaction-example.png
index 2e34bbf6..2e34bbf6 100644
--- a/examples/webengine/webengineaction/doc/images/webengineaction-example.png
+++ b/examples/webenginequick/webengineaction/doc/images/webengineaction-example.png
Binary files differ
diff --git a/examples/webengine/webengineaction/doc/src/webengineaction.qdoc b/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc
index 672f86f0..096a16fc 100644
--- a/examples/webengine/webengineaction/doc/src/webengineaction.qdoc
+++ b/examples/webenginequick/webengineaction/doc/src/webengineaction.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example webengine/webengineaction
+ \example webenginequick/webengineaction
\title WebEngine Action Example
\ingroup webengine-examples
\brief A simple browser implemented using WebEngineActions.
@@ -50,7 +50,7 @@
\l{WebEngineAction}. Clicking the button triggers backwards navigation on the
originating \l{WebEngineView} of the action.
- \quotefromfile webengine/webengineaction/main.qml
+ \quotefromfile webenginequick/webengineaction/main.qml
\skipto ToolButton {
\printuntil }
@@ -58,7 +58,7 @@
\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
+ \quotefromfile webenginequick/webengineaction/main.qml
\skipto property Menu contextMenu: Menu {
\printuntil /^ {8}\}/
diff --git a/examples/webengine/webengineaction/main.cpp b/examples/webenginequick/webengineaction/main.cpp
index a30749eb..a30749eb 100644
--- a/examples/webengine/webengineaction/main.cpp
+++ b/examples/webenginequick/webengineaction/main.cpp
diff --git a/examples/webengine/webengineaction/main.qml b/examples/webenginequick/webengineaction/main.qml
index fbb76411..fbb76411 100644
--- a/examples/webengine/webengineaction/main.qml
+++ b/examples/webenginequick/webengineaction/main.qml
diff --git a/examples/webengine/webengineaction/qml.qrc b/examples/webenginequick/webengineaction/qml.qrc
index 5f6483ac..5f6483ac 100644
--- a/examples/webengine/webengineaction/qml.qrc
+++ b/examples/webenginequick/webengineaction/qml.qrc
diff --git a/examples/webengine/webengineaction/webengineaction.pro b/examples/webenginequick/webengineaction/webengineaction.pro
index aeed568f..7ef0a8bc 100644
--- a/examples/webengine/webengineaction/webengineaction.pro
+++ b/examples/webenginequick/webengineaction/webengineaction.pro
@@ -6,5 +6,5 @@ SOURCES += main.cpp
RESOURCES += qml.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/webengine/webengineaction
+target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/webengineaction
INSTALLS += target
diff --git a/examples/webengine/webengine.pro b/examples/webenginequick/webenginequick.pro
index 05886839..05886839 100644
--- a/examples/webengine/webengine.pro
+++ b/examples/webenginequick/webenginequick.pro
diff --git a/examples/webenginewidgets/CMakeLists.txt b/examples/webenginewidgets/CMakeLists.txt
index 651a0134..a0dc6330 100644
--- a/examples/webenginewidgets/CMakeLists.txt
+++ b/examples/webenginewidgets/CMakeLists.txt
@@ -16,6 +16,7 @@ if(QT_FEATURE_webengine_printing_and_pdf)
add_subdirectory(printme)
add_subdirectory(html2pdf)
endif()
-if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING AND NOT QT_FEATURE_webengine_native_spellchecker)
+if(QT_FEATURE_webengine_spellchecker AND NOT CMAKE_CROSSCOMPILING
+ AND NOT QT_FEATURE_webengine_native_spellchecker AND NOT WIN32)
add_subdirectory(spellchecker)
endif()
diff --git a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
index 91a0899c..4cb51436 100644
--- a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
@@ -9,7 +9,7 @@
"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>
diff --git a/examples/webenginewidgets/maps/doc/src/maps.qdoc b/examples/webenginewidgets/maps/doc/src/maps.qdoc
index 489a5a78..75923c8f 100644
--- a/examples/webenginewidgets/maps/doc/src/maps.qdoc
+++ b/examples/webenginewidgets/maps/doc/src/maps.qdoc
@@ -38,9 +38,9 @@
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 Location} 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
@@ -94,5 +94,5 @@
\printuntil /^\}/
- \sa {html5-geolocation}{Qt WebEngine HTML5 Geolocation}, {Qt Location}
+ \sa {html5-geolocation}{Qt WebEngine HTML5 Geolocation}
*/
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.cpp b/examples/webenginewidgets/markdowneditor/mainwindow.cpp
index 28d6f564..af5a6955 100644
--- a/examples/webenginewidgets/markdowneditor/mainwindow.cpp
+++ b/examples/webenginewidgets/markdowneditor/mainwindow.cpp
@@ -56,6 +56,7 @@
#include <QFileDialog>
#include <QFontDatabase>
#include <QMessageBox>
+#include <QStatusBar>
#include <QTextStream>
#include <QWebChannel>
@@ -83,7 +84,7 @@ MainWindow::MainWindow(QWidget *parent) :
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->actionExit, &QAction::triggered, this, &QWidget::close);
connect(ui->editor->document(), &QTextDocument::modificationChanged,
ui->actionSave, &QAction::setEnabled);
@@ -109,6 +110,7 @@ void MainWindow::openFile(const QString &path)
}
m_filePath = path;
ui->editor->setPlainText(f.readAll());
+ statusBar()->showMessage(tr("Opened %1").arg(QDir::toNativeSeparators(path)));
}
bool MainWindow::isModified() const
@@ -139,12 +141,11 @@ void MainWindow::onFileOpen()
return;
}
- QString path = QFileDialog::getOpenFileName(this,
- tr("Open MarkDown File"), "", tr("MarkDown File (*.md)"));
- if (path.isEmpty())
- return;
-
- openFile(path);
+ QFileDialog dialog(this, tr("Open MarkDown File"));
+ dialog.setMimeTypeFilters({"text/markdown"});
+ dialog.setAcceptMode(QFileDialog::AcceptOpen);
+ if (dialog.exec() == QDialog::Accepted)
+ openFile(dialog.selectedFiles().constFirst());
}
void MainWindow::onFileSave()
@@ -165,25 +166,29 @@ void MainWindow::onFileSave()
str << ui->editor->toPlainText();
ui->editor->document()->setModified(false);
+
+ statusBar()->showMessage(tr("Wrote %1").arg(QDir::toNativeSeparators(m_filePath)));
}
void MainWindow::onFileSaveAs()
{
- QString path = QFileDialog::getSaveFileName(this,
- tr("Save MarkDown File"), "", tr("MarkDown File (*.md, *.markdown)"));
- if (path.isEmpty())
+ QFileDialog dialog(this, tr("Save MarkDown File"));
+ dialog.setMimeTypeFilters({"text/markdown"});
+ dialog.setAcceptMode(QFileDialog::AcceptSave);
+ dialog.setDefaultSuffix("md");
+ if (dialog.exec() != QDialog::Accepted)
return;
- m_filePath = path;
+
+ m_filePath = dialog.selectedFiles().constFirst();
onFileSave();
}
-void MainWindow::onExit()
+void MainWindow::closeEvent(QCloseEvent *e)
{
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;
+ e->ignore();
}
- close();
}
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.h b/examples/webenginewidgets/markdowneditor/mainwindow.h
index bb7a7ab0..fc18dde2 100644
--- a/examples/webenginewidgets/markdowneditor/mainwindow.h
+++ b/examples/webenginewidgets/markdowneditor/mainwindow.h
@@ -72,12 +72,14 @@ public:
void openFile(const QString &path);
+protected:
+ void closeEvent(QCloseEvent *e) override;
+
private slots:
void onFileNew();
void onFileOpen();
void onFileSave();
void onFileSaveAs();
- void onExit();
private:
bool isModified() const;
diff --git a/examples/webenginewidgets/markdowneditor/previewpage.h b/examples/webenginewidgets/markdowneditor/previewpage.h
index eb7d7ab0..2e7cfaea 100644
--- a/examples/webenginewidgets/markdowneditor/previewpage.h
+++ b/examples/webenginewidgets/markdowneditor/previewpage.h
@@ -57,10 +57,10 @@ class PreviewPage : public QWebEnginePage
{
Q_OBJECT
public:
- explicit PreviewPage(QObject *parent = nullptr) : QWebEnginePage(parent) {}
+ using QWebEnginePage::QWebEnginePage;
protected:
- bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame);
+ bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override;
};
#endif // PREVIEWPAGE_H
diff --git a/examples/webenginewidgets/printme/doc/src/printme.qdoc b/examples/webenginewidgets/printme/doc/src/printme.qdoc
index 1ba37d0c..f17fae1a 100644
--- a/examples/webenginewidgets/printme/doc/src/printme.qdoc
+++ b/examples/webenginewidgets/printme/doc/src/printme.qdoc
@@ -66,8 +66,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 +77,23 @@
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. Because this call is asynchronous, we need to use
+ a local event loop. We begin the local event loop by calling
+ \l{QEventLoop::exec()}.
\quotefromfile webenginewidgets/printme/printhandler.cpp
\skipto PrintHandler::printDocument(
\printuntil /^\}/
- To do actual painting on a printer, we call the \l QWebEngineView::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.
+
+ \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/printhandler.cpp b/examples/webenginewidgets/printme/printhandler.cpp
index 200f2f30..283a6657 100644
--- a/examples/webenginewidgets/printme/printhandler.cpp
+++ b/examples/webenginewidgets/printme/printhandler.cpp
@@ -49,9 +49,7 @@
****************************************************************************/
#include "printhandler.h"
-#include <QEventLoop>
#include <QPrintDialog>
-#include <QPrinter>
#include <QPainter>
#include <QPrintPreviewDialog>
#include <QWebEngineView>
@@ -59,7 +57,7 @@
PrintHandler::PrintHandler(QObject *parent)
: QObject(parent)
{
-
+ m_printer.setResolution(300);
}
void PrintHandler::setView(QWebEngineView *view)
@@ -67,36 +65,37 @@ void PrintHandler::setView(QWebEngineView *view)
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_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;
- connect(m_view, &QWebEngineView::printFinished, [&](bool success) { result = success; loop.quit(); });
m_view->print(printer);
- loop.exec();
- if (!result) {
+ m_waitForResult.exec();
+}
+
+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()
@@ -106,9 +105,7 @@ void PrintHandler::printPreview()
if (m_inPrintPreview)
return;
m_inPrintPreview = true;
- QPrinter printer;
- printer.setResolution(300);
- QPrintPreviewDialog preview(&printer, m_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 663fd73d..ca5d0b03 100644
--- a/examples/webenginewidgets/printme/printhandler.h
+++ b/examples/webenginewidgets/printme/printhandler.h
@@ -51,7 +51,9 @@
#ifndef PRINTHANDLER_H
#define PRINTHANDLER_H
+#include <QEventLoop>
#include <QObject>
+#include <QPrinter>
QT_BEGIN_NAMESPACE
class QPainter;
@@ -70,9 +72,12 @@ public slots:
void print();
void printPreview();
void printDocument(QPrinter *printer);
+ void printFinished(bool success);
private:
QWebEngineView *m_view = nullptr;
+ QPrinter m_printer;
+ QEventLoop m_waitForResult;
bool m_inPrintPreview = false;
};
diff --git a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
index 853adeb2..d81f5bf2 100644
--- a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
@@ -9,7 +9,7 @@
"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>
diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index 5bd0a5ef..31be9f34 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -133,17 +133,18 @@ inline QString questionForFeature(QWebEnginePage::Feature feature)
void WebView::setPage(WebPage *page)
{
- WebPage *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);
+ 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);
+ }
createWebActionTrigger(page,QWebEnginePage::Forward);
createWebActionTrigger(page,QWebEnginePage::Back);
createWebActionTrigger(page,QWebEnginePage::Reload);
diff --git a/examples/webenginewidgets/spellchecker/CMakeLists.txt b/examples/webenginewidgets/spellchecker/CMakeLists.txt
index f05cd74f..5cec0087 100644
--- a/examples/webenginewidgets/spellchecker/CMakeLists.txt
+++ b/examples/webenginewidgets/spellchecker/CMakeLists.txt
@@ -65,14 +65,18 @@ else()
set(spellcheckerDir ${CMAKE_CURRENT_BINARY_DIR}/qtwebengine_dictionaries)
endif()
+# note setting QT_WEBENGINE_ICU_DATA below is not required if this example
+# is not compiled as part of qtwebengine module build
+
foreach(dictFile ${dicts})
get_filename_component(dictName ${dictFile} NAME_WE)
add_custom_command(TARGET spellchecker
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${spellcheckerDir}
- COMMAND $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict>
- ${CMAKE_CURRENT_SOURCE_DIR}/dict/${dictFile}
- ${spellcheckerDir}/${dictName}.bdic
+ COMMAND ${CMAKE_COMMAND} -E env
+ $<IF:$<BOOL:${WEBENGINE_MODULE_BUILD}>,QT_WEBENGINE_ICU_DATA_DIR=${CMAKE_CURRENT_BINARY_DIR}/../../../resources,CMAKE=AWESOME>
+ $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict>
+ ${CMAKE_CURRENT_SOURCE_DIR}/dict/${dictFile} ${spellcheckerDir}/${dictName}.bdic
COMMENT "Running qwebengine_convert_dict"
)
endforeach()
diff --git a/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
index ffca1812..f779da7e 100644
--- a/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
@@ -9,7 +9,7 @@
"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>
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
deleted file mode 100644
index c7440fa7..00000000
--- 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 6c3ef3cb..00000000
--- a/mkspecs/features/functions.prf
+++ /dev/null
@@ -1,138 +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) {
- isEmpty(QMAKE_NINJA) {
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir))
- win32: out = $${out}.exe
- QMAKE_NINJA = $$out
- }
- return($$QMAKE_NINJA)
-}
-
-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)
- contains(qtArch, "mips64el"): 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 bbaed233..00000000
--- a/mkspecs/features/gn_generator.prf
+++ /dev/null
@@ -1,268 +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
-
-# Chromium already enables warnings, so enabling them again will just
-# re-enable all the warnings disabled by Chromium.
-QMAKE_CFLAGS -= $$QMAKE_CFLAGS_WARN_ON
-QMAKE_CXXFLAGS -= $$QMAKE_CXXFLAGS_WARN_ON
-
-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 += " ]"
-}
-
-# 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 00000000..568580c6
--- /dev/null
+++ b/qt_cmdline.cmake
@@ -0,0 +1,4 @@
+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/src/3rdparty b/src/3rdparty
-Subproject b5b02c3da75a153f105c0ddf0d0e7fa7a1324c1
+Subproject 6b7b3f1bf9f41c3ae7afc359c90c3cc80687f00
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f46b55f8..501a687f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,31 +1,183 @@
cmake_minimum_required(VERSION 3.19)
+##
+# MAIN CONFIGURE
+##
-if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR)
- get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." REALPATH)
+get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." REALPATH)
+get_filename_component(WEBENGINE_ROOT_BUILD_DIR "${PROJECT_BINARY_DIR}" REALPATH)
+
+# 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
+##
+
+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" 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()
+
+if(NOT QT_FEATURE_qtwebengine_build)
+ 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()
+
+##
+# MODULES
+##
+
+if(QT_FEATURE_qtwebengine_build)
+ add_subdirectory(core)
+ add_subdirectory(process)
+ if(QT_FEATURE_qtwebengine_widgets_build)
+ add_subdirectory(webenginewidgets)
+ endif()
+ if(QT_FEATURE_qtwebengine_quick_build)
+ add_subdirectory(webenginequick)
+ endif()
+endif()
+if(QT_FEATURE_qtpdf_build)
+ add_subdirectory(pdf)
+ # keep log order, pdf build after webengine
+ if(QT_FEATURE_qtwebengine_build)
+ add_dependencies(run_pdf_GnReady WebEngineCore)
+ endif()
+ if(QT_FEATURE_qtwebengine_widgets_build)
+ add_dependencies(run_pdf_GnReady WebEngineWidgets)
+ endif()
+ if(QT_FEATURE_qtwebengine_quick_build)
+ add_dependencies(run_pdf_GnReady 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_build)
+ add_dependencies(run_core_NinjaReady ninja)
+ endif()
+ if(QT_FEATURE_qtpdf_build)
+ add_dependencies(run_pdf_NinjaReady ninja)
+ endif()
endif()
-include(${WEBENGINE_ROOT_SOURCE_DIR}/.cmake.conf)
-include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
+##
+# GN PROJECT
+##
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${WEBENGINE_ROOT_SOURCE_DIR}/cmake")
+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}
+ )
+ if(QT_FEATURE_qtwebengine_build)
+ add_dependencies(run_core_GnReady gn)
+ endif()
+ if(QT_FEATURE_qtpdf_build)
+ add_dependencies(run_pdf_GnReady gn)
+ endif()
+ set(INSTALL_GN 1 CACHE INTERNAL "")
+endif()
-assertRunAsTopLevelBuild(TRUE)
+##
+# HOST PROJECT
+##
-project(QtWebEngineRepo
- VERSION "${QT_REPO_MODULE_VERSION}"
- DESCRIPTION "QtWebEngineRepo for QtWebEngineCore, QtWebEngine, QtWebEngineWidgets, QtPdf modules"
- HOMEPAGE_URL "https://qt.io"
- LANGUAGES CXX C)
+if(CMAKE_CROSSCOMPILING)
-# Make sure we use the fixed BASE argument of qt_add_resource.
-set(QT_USE_FIXED_QT_ADD_RESOURCE_BASE TRUE)
+ if(NOT Gn_FOUND)
+ message(FATAL_ERROR "\nHost gn not found - cross compilation not possible")
+ endif()
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+ 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}/lib/cmake/Qt6/qt.toolchain.cmake
+ -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()
-qt_build_repo_begin()
-add_subdirectory(core)
-add_subdirectory(process)
-add_subdirectory(webenginewidgets)
-add_subdirectory(webenginequick)
-qt_build_repo_end()
+# install gn for cross build
+if(LINUX AND INSTALL_GN)
+ get_install_config(installConfig)
+ message(${installConfig})
+ install(
+ PROGRAMS ${installDir}/bin/gn
+ CONFIGURATIONS ${installConfig}
+ RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}"
+ )
+endif()
diff --git a/src/buildtools/buildtools.pro b/src/buildtools/buildtools.pro
deleted file mode 100644
index 1366d18d..00000000
--- 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 cf990c79..00000000
--- a/src/buildtools/config/common.pri
+++ /dev/null
@@ -1,113 +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 \
- init_stack_vars=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_allowlist_generation=false \
- enable_swiftshader=false \
- enable_swiftshader_vulkan=false \
- angle_enable_swiftshader=false \
- enable_web_speech=false \
- enable_widevine=true \
- forbid_non_component_debug_builds=false \
- has_native_accessibility=false \
- safe_browsing_mode=0 \
- skia_use_dawn=false \
- toolkit_views=false \
- treat_warnings_as_errors=false \
- use_allocator_shim=false \
- use_allocator=\"none\" \
- use_custom_libcxx=false \
- chrome_pgo_phase=0 \
- enable_hangout_services_extension=true
-
-# Closure compile requires Java
-gn_args += \
- optimize_webui=false \
- enable_js_type_check=false
-
-# We always embed v8 startup data currently
-gn_args += \
- v8_use_external_startup_data=false
-
-# Uses special flags for clang not available on xcode, and messes up gdb debugging too.
-gn_args += \
- strip_absolute_paths_from_debug_symbols=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
- # Just doesn't work in many configurations:
- gn_args += from_here_uses_location_builtins=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 8c11faa1..00000000
--- 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/linking.pri b/src/buildtools/config/linking.pri
deleted file mode 100644
index f295e2c6..00000000
--- a/src/buildtools/config/linking.pri
+++ /dev/null
@@ -1,77 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-
-linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
-
-!include($$linking_pri) {
- error("Could not find the linking information that gn should have generated.")
-}
-
-# Do not precompile any headers. We are only interested in the linker step.
-PRECOMPILED_HEADER =
-
-isEmpty(NINJA_OBJECTS): error("Missing object files from linking pri.")
-isEmpty(NINJA_LFLAGS): error("Missing linker flags from linking pri")
-isEmpty(NINJA_ARCHIVES): error("Missing archive files from linking pri")
-isEmpty(NINJA_LIBS): error("Missing library files from 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)
-
-if(macos|ios) {
- !static {
- QMAKE_LFLAGS += -Wl,-filelist,$$shell_quote($${RSP_OBJECT_FILE})
- QMAKE_LFLAGS += @$${RSP_ARCHIVE_FILE}
- } else {
- OBJECTS += $$NINJA_OBJECTS
- LIBS_PRIVATE += $${NINJA_ARCHIVES}
- }
-}
-
-linux {
- !static {
- QMAKE_LFLAGS += @$${RSP_OBJECT_FILE}
- QMAKE_LFLAGS += -Wl,--start-group @$${RSP_ARCHIVE_FILE} -Wl,--end-group
- } else {
- OBJECTS += $$NINJA_OBJECTS
- LIBS_PRIVATE += -Wl,--start-group $${NINJA_ARCHIVES} -Wl,--end-group
- }
-}
-
-win32 {
- !static {
- QMAKE_LFLAGS += @$${RSP_OBJECT_FILE}
- QMAKE_LFLAGS += @$${RSP_ARCHIVE_FILE}
- } else {
- OBJECTS += $$NINJA_OBJECTS
- LIBS_PRIVATE += $${NINJA_ARCHIVES}
- }
-}
-
-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
diff --git a/src/buildtools/config/linux.pri b/src/buildtools/config/linux.pri
deleted file mode 100644
index 7507d51e..00000000
--- 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 \
- use_udev=true \
- use_bundled_fontconfig=false \
- use_sysroot=false \
- enable_session_service=false \
- is_cfi=false \
- use_ozone=true \
- use_x11=false \
- 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 b53f9170..00000000
--- 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 e7f869a1..00000000
--- a/src/buildtools/config/support.pri
+++ /dev/null
@@ -1,257 +0,0 @@
-defineTest(qtwebengine_skipBuild) {
- skipBuildReason = $$1
- export(skipBuildReason)
-}
-
-# this should match webengine-core-support
-defineReplace(qtwebengine_checkWebEngineCoreError) {
- !linux:!win32:!macos {
- qtwebengine_skipBuild("QtWebEngine can be built only on Linux, Windows or macOS.")
- 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_checkForNodejs(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) {
- !linux:!win32:!macos:!ios {
- qtwebengine_skipBuild("QtPdf can be built only on Linux, Windows, macOS or iOS.")
- 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_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_checkForNodejs) {
- module = $$1
- !qtConfig(webengine-nodejs) {
- qtwebengine_skipBuild("Nodejs 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 843d6f2b..00000000
--- a/src/buildtools/config/windows.pri
+++ /dev/null
@@ -1,91 +0,0 @@
-include(common.pri)
-
-gn_args += \
- use_sysroot=false \
- enable_session_service=false \
- ninja_use_custom_environment_files=false \
- win_linker_timing=true \
- com_init_check_hook_disabled=true \
- heterogeneous_executables=true \
- enable_vr=false
-
-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) {
- # 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 += \
- 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 ba42c2c3..00000000
--- a/src/buildtools/configure.json
+++ /dev/null
@@ -1,843 +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-xkbfile": {
- "label": "xkbfile",
- "sources": [
- { "type": "pkgConfig", "args": "xkbfile" }
- ]
- },
- "webengine-nss": {
- "label": "nss >= 3.26",
- "sources": [
- { "type": "pkgConfig", "args": "nss >= 3.26" }
- ]
- },
- "webengine-x11" : {
- "label" : "x11",
- "sources": [
- { "type": "pkgConfig", "args": "x11" }
- ]
- },
- "webengine-xproto-gl": {
- "label": "xproto (glproto)",
- "sources": [
- { "type": "pkgConfig", "args": "glproto" }
- ]
- },
- "webengine-glib": {
- "label": "glib-2.0 >= 2.32.0",
- "sources": [
- { "type": "pkgConfig", "args": "glib-2.0 >= 2.32.0" }
- ]
- },
- "webengine-harfbuzz": {
- "label": "harfbuzz >= 2.4.0",
- "sources": [
- { "type": "pkgConfig", "args": "harfbuzz >= 2.4.0 harfbuzz-subset >= 2.4.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-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-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 >= 65",
- "sources": [
- { "type": "pkgConfig", "args": "icu-uc >= 65 icu-i18n >= 65" }
- ]
- },
- "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;",
- "auto b = VPX_IMG_FMT_NV12;"
- ]
- },
- "headers": [ "vpx/vpx_encoder.h", "vpx/vp8cx.h", "vpx/vpx_image.h" ],
- "sources": [
- { "type": "pkgConfig", "args": "vpx >= 1.10.0" }
- ]
- }
- },
-
- "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",
- "log": "path"
- },
- "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-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"
- },
- "webengine-noexecstack" : {
- "label": "linker supports -z noexecstack",
- "type": "linkerSupportsFlag",
- "flag": "-z,noexecstack"
- },
- "webengine-nodejs": {
- "label": "node.js",
- "type": "detectNodeJS",
- "log": "version10"
- }
- },
- "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
- && features.webengine-nodejs
- && (!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 || config.ios)
- && 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-nodejs": {
- "label": "node.js",
- "condition": "tests.webengine-nodejs",
- "output": [ "privateFeature" ]
- },
- "webengine-nodejs10": {
- "label": "node.js",
- "condition": "tests.webengine-nodejs && tests.webengine-nodejs.version10",
- "output": [ "privateFeature" ]
- },
- "webengine-system-ninja": {
- "label": "Use System Ninja",
- "condition": "tests.webengine-ninja",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "QMAKE_NINJA", "value": "tests.webengine-ninja.path" }
- ]
- },
- "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-xkbfile": {
- "label": "xkbfile",
- "condition": "libs.webengine-xkbfile",
- "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-system-xproto-gl" : {
- "label": "xproto (glproto)",
- "condition": "config.unix && libs.webengine-xproto-gl",
- "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-xproto-gl
- && features.webengine-system-xtst
- && features.webengine-system-xkbfile",
- "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-qt-harfbuzz" : {
- "label": "qtharfbuzz",
- "condition": "config.static && !features.system-harfbuzz && features.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-qt-zlib" : {
- "label": "QtZlib",
- "condition": "config.static && !features.system-zlib",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libevent" : {
- "label": "libevent",
- "condition": "config.unix && libs.webengine-libevent",
- "output": [ "privateFeature" ]
- },
- "webengine-system-png" : {
- "label": "png",
- "condition": "config.unix && features.system-png && libs.webengine-png",
- "output": [ "privateFeature" ]
- },
- "webengine-qt-png" : {
- "label": "qtlibpng",
- "condition" : "config.static && !features.system-png && features.png",
- "output": [ "privateFeature" ]
- },
- "webengine-system-jpeg" : {
- "label": "JPEG",
- "condition": "config.unix && features.system-jpeg && libs.webengine-jpeglib",
- "output": [ "privateFeature" ]
- },
- "webengine-qt-jpeg" : {
- "label": "qtlibjpeg",
- "condition": "config.static && !features.system-jpeg && features.jpeg",
- "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-qt-freetype" : {
- "label": "qtfreetype",
- "condition": "config.static && !features.system-freetype && features.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" ]
- },
- "webengine-noexecstack": {
- "label": "linker supports -z noexecstack",
- "condition": "config.unix && tests.webengine-noexecstack",
- "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",
- {
- "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-xproto-gl",
- "webengine-system-xtst",
- "webengine-system-xkbfile"
- ]
- },
- {
- "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-libxml2",
- "webengine-system-lcms2",
- "webengine-system-png",
- "webengine-system-jpeg",
- "webengine-system-harfbuzz",
- "webengine-system-freetype"
- ]
- },
- {
- "section": "Qt 3rdparty libs",
- "condition": "config.static",
- "entries": [
- "webengine-qt-freetype",
- "webengine-qt-harfbuzz",
- "webengine-qt-png",
- "webengine-qt-jpeg",
- "webengine-qt-zlib"
- ]
- }
- ]
- }
- ]
-}
diff --git a/src/buildtools/configure_host.pro b/src/buildtools/configure_host.pro
deleted file mode 100644
index dd0d3e32..00000000
--- 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 31aa283f..00000000
--- 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 9e8cfe15..00000000
--- a/src/buildtools/gn.pro
+++ /dev/null
@@ -1,39 +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)
- # 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)) && $$system_quote($$system_path($$ninjaPath())) $$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 66a6d5aa..00000000
--- 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
index 21c1e3db..f26a9a9e 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -1,32 +1,19 @@
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()
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${WEBENGINE_ROOT_SOURCE_DIR}/cmake")
-set(buildDir "${CMAKE_CURRENT_BINARY_DIR}")
-
-include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
-assertRunAsTopLevelBuild(TRUE)
-
-add_subdirectory(api)
-add_subdirectory(tools)
-
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
-find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT REQUIRED)
find_package(Ninja 1.7.2 REQUIRED)
find_package(Python2 2.7.5 REQUIRED)
find_package(Nodejs 10.19 REQUIRED)
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(XSCRNSAVER xscrnsaver)
- create_pkg_config_host_wrapper()
+ create_pkg_config_host_wrapper(${CMAKE_CURRENT_BINARY_DIR})
endif()
+set(buildDir "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_subdirectory(api)
+add_subdirectory(tools)
+
##
# TOOLCHAIN SETUP
##
@@ -36,36 +23,25 @@ if(LINUX)
endif()
##
-# MULTICONFIG SETUP
+# GN BUILD SETUP
##
-if(QT_GENERATOR_IS_MULTI_CONFIG)
- set(configs ${CMAKE_CONFIGURATION_TYPES})
-else()
- set(configs ${CMAKE_BUILD_TYPE})
-endif()
+addSyncTargets(core)
-if(NOT QT_IS_MACOS_UNIVERSAL)
- set(GN_ARCHITECTURES ${CMAKE_SYSTEM_PROCESSOR})
-else()
- set(GN_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES})
-endif()
-
-foreach(arch ${GN_ARCHITECTURES})
- if(QT_IS_MACOS_UNIVERSAL)
- set(buildDir "${CMAKE_CURRENT_BINARY_DIR}/${arch}")
- endif()
+get_configs(configs)
+get_architectures(archs)
+foreach(arch ${archs})
foreach(config ${configs})
- ##
- # BUILD.gn SETUP
- ##
- unset(buildGn)
- set(buildGn buildGnWebEngineCore_${config}_${arch})
-
- add_gn_target(${buildGn} SOURCES DEFINES CXX_COMPILE_OPTIONS C_COMPILE_OPTIONS INCLUDES)
+ ##
+ # 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)
@@ -92,10 +68,10 @@ foreach(arch ${GN_ARCHITECTURES})
DEFINES
QT_NO_KEYWORDS
QT_USE_QSTRINGBUILDER
- QTWEBENGINECORE_VERSION_STR=\\\\\"${QT_REPO_MODULE_VERSION}\\\\\"
- QTWEBENGINEPROCESS_NAME=\\\\\"${qtWebEngineProcessName}\\\\\"
+ QTWEBENGINECORE_VERSION_STR=\\\\\\\\\"${QT_REPO_MODULE_VERSION}\\\\\\\\\"
+ QTWEBENGINEPROCESS_NAME=\\\\\\\\\"${qtWebEngineProcessName}\\\\\\\\\"
BUILDING_CHROMIUM
- ${forwardDeclarationMacro}
+ "${forwardDeclarationMacro}"
CXX_COMPILE_OPTIONS
${gnCxxCompileOptions}
SOURCES
@@ -120,7 +96,6 @@ foreach(arch ${GN_ARCHITECTURES})
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/display_skia_output_device.cpp compositor/display_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
@@ -224,6 +199,7 @@ foreach(arch ${GN_ARCHITECTURES})
SOURCES
compositor/compositor_resource_fence.cpp compositor/compositor_resource_fence.h
compositor/display_gl_output_surface.cpp compositor/display_gl_output_surface.h
+ compositor/display_skia_output_device.cpp compositor/display_skia_output_device.h
)
extend_gn_target(${buildGn} CONDITION MACOS AND QT_FEATURE_opengl
@@ -281,15 +257,9 @@ foreach(arch ${GN_ARCHITECTURES})
renderer/extensions/resource_request_policy_qt.cpp renderer/extensions/resource_request_policy_qt.h
)
- read_gn_target(${buildGn} ${WEBENGINE_ROOT_BUILD_DIR}/src/core/api/${config}/gn_config.cxx.cmake)
- read_gn_target(${buildGn} ${WEBENGINE_ROOT_BUILD_DIR}/src/core/api/${config}/gn_config.c.cmake)
- configure_gn_target(${buildGn} ${config}
- ${WEBENGINE_ROOT_SOURCE_DIR}/src/core/configure/BUILD.root.gn.in ${buildDir}/${config}/BUILD.gn)
-
-
- ##
- # GN PARAMETERS SETUP
- ##
+ ##
+ # GN PARAMETERS SETUP
+ ##
unset(gnArgArg)
@@ -300,7 +270,7 @@ foreach(arch ${GN_ARCHITECTURES})
append_pkg_config_setup(gnArgArg)
list(APPEND gnArgArg
- qtwebengine_target="${buildDir}/${config}:QtWebEngineCore"
+ qtwebengine_target="${buildDir}/${config}/${arch}:QtWebEngineCore"
enable_media_remoting=false
enable_message_center=false
enable_nacl=false
@@ -321,7 +291,7 @@ foreach(arch ${GN_ARCHITECTURES})
enable_js_type_check=false
v8_use_external_startup_data=false
strip_absolute_paths_from_debug_symbols=false
- blink_symbol_level=0
+ disable_ftp_support=true
)
extend_gn_list(gnArgArg
@@ -462,174 +432,60 @@ foreach(arch ${GN_ARCHITECTURES})
)
endif()
-
- ##
- # GN CALL
- ##
-
- execute_gn(gnArgArg)
-
- ##
- # NINJA CALL
- ##
-
- # 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
-
- if(WIN32)
- set(sandboxOutput ${buildDir}/${config}/QtWebEngineCoreSandbox.lib)
- set(sandboxTarget QtWebEngineCoreSandbox)
- else()
- unset(sandboxOutput)
- unset(sandboxTarget)
- endif()
-
- execute_ninja(QtWebEngineCore ${sandboxTarget})
+ 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
##
-if (QT_IS_MACOS_UNIVERSAL)
- target_include_directories(WebEngineCore PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/$<CONFIG>/gen
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/$<CONFIG>/gen/third_party/perfetto
- ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/$<CONFIG>/gen/third_party/perfetto/build_config
- )
-else()
- target_include_directories(WebEngineCore PRIVATE
- ${buildDir}/$<CONFIG>/gen
- ${buildDir}/$<CONFIG>/gen/third_party/perfetto
- ${buildDir}/$<CONFIG>/gen/third_party/perfetto/build_config
- )
-endif()
-
-if (QT_IS_MACOS_UNIVERSAL)
-
- set(buildDir "${CMAKE_CURRENT_BINARY_DIR}")
- foreach(config ${configs})
-
- extend_target_with_gn_libs(WebEngineCore ${config} QtWebEngineCore.cmake QtWebEngineCore.stamp)
-
- endforeach()
- # in the end, set the build dir back to one of the archs, to make sure the resources get copied alright
- set(buildDir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}")
-
-else()
-
- if(WIN32)
- add_library(WebEngineCoreSandbox STATIC IMPORTED GLOBAL)
- add_dependencies(WebEngineCoreSandbox ninja)
- endif()
-
- foreach(config ${configs})
-
- extend_target_with_gn_objects(WebEngineCore ${config} QtWebEngineCore.cmake QtWebEngineCore.stamp)
-
- if(WIN32)
- string(TOUPPER ${config} cfg)
- set(sandboxLibraryPath ${buildDir}/${config}/QtWebEngineCoreSandbox.lib)
- set_property(TARGET WebEngineCoreSandbox
- PROPERTY IMPORTED_LOCATION_${cfg} ${sandboxLibraryPath})
- set_source_files_properties(${sandboxLibraryPath} PROPERTIES GENERATED TRUE)
- add_custom_command(OUTPUT ${sandboxLibraryPath} DEPENDS ${sandboxOutput})
- add_custom_target(generate_sandbox_${cfg} DEPENDS ${sandboxLibraryPath})
- endif()
-
- endforeach()
+set(arch ${CMAKE_SYSTEM_PROCESSOR})
+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
+)
+
+add_gn_build_aritfacts_to_target(WebEngineCore QtWebEngineCore core ${buildDir})
+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()
##
-# WEBENGINECORE RESOURCES
+# SANDBOX
##
-#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)
-
-get_install_config(config)
-
-foreach(loc ${localeList})
- get_filename_component(locSourcePath ${buildDir}/${config}/qtwebengine_locales/${loc}.pak REALPATH)
- list(APPEND localeFiles ${locSourcePath})
-endforeach()
-
-foreach(res ${resourceList})
- get_filename_component(resSourcePath ${buildDir}/${config}/${res} REALPATH)
- list(APPEND resourceFiles ${resSourcePath})
-endforeach()
-
-if (NOT QT_FEATURE_webengine_system_icu)
- get_filename_component(icuFile ${buildDir}/${config}/icudtl.dat REALPATH)
- list(APPEND resourceFiles ${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 ${buildDir}/${config}/QtWebEngineCore.stamp)
- add_custom_target(generate_resources_${config} DEPENDS ${allResourceFiles})
-else()
- install(FILES ${localeFiles}
- DESTINATION translations/qtwebengine_locales
- CONFIGURATIONS ${config}
- )
- install(FILES ${resourceFiles}
- DESTINATION resources
- CONFIGURATIONS ${config}
- )
-# install (again) for superbuild
- install(FILES ${localeFiles}
- DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/translations/qtwebengine_locales
- CONFIGURATIONS ${config}
- )
- install(FILES ${resourceFiles}
- DESTINATION ${WEBENGINE_ROOT_BUILD_DIR}/resources
- CONFIGURATIONS ${config}
- )
- if(NOT QT_WILL_INSTALL)
- # TODO: Could we get rid of ALL?
- add_custom_target(
- install_resources_${config}
- ALL
- DEPENDS ${buildDir}/${config}/QtWebEngineCore.stamp
- COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_INSTALL_PREFIX}/resources
- COMMAND ${CMAKE_COMMAND} -E copy
- ${resourceFiles}
- ${CMAKE_INSTALL_PREFIX}/resources)
- add_custom_target(
- install_locales_${config}
- ALL
- DEPENDS ${buildDir}/${config}/QtWebEngineCore.stamp
- COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_INSTALL_PREFIX}/translations/qtwebengine_locales
- COMMAND ${CMAKE_COMMAND} -E copy
- ${localeFiles}
- ${CMAKE_INSTALL_PREFIX}/translations/qtwebengine_locales)
- endif()
+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()
##
@@ -641,18 +497,10 @@ if(QT_FEATURE_webengine_spellchecker)
target_include_directories(${dict_target_name} PRIVATE
../3rdparty/chromium
../3rdparty/chromium/third_party/boringssl/src/include
- ${buildDir}/${config}/gen
+ ${buildDir}/$<CONFIG>/${arch}/gen
)
- if(QT_IS_MACOS_UNIVERSAL)
- set(buildDir "${CMAKE_CURRENT_BINARY_DIR}")
- foreach(config ${configs})
- extend_target_with_gn_libs(${dict_target_name} ${config} convert_dict.cmake QtWebEngineCore.stamp)
- endforeach()
-
- else()
- foreach(config ${configs})
- extend_target_with_gn_objects(${dict_target_name} ${config} convert_dict.cmake "")
- endforeach()
- endif()
+ add_gn_build_aritfacts_to_target(${dict_target_name} convert_dict core ${buildDir})
+ add_dependencies(${dict_target_name} run_core_NinjaDone)
+ add_dependencies(${dict_target_name} WebEngineCore)
endif()
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index e1fa62cd..c74ac84e 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -1,19 +1,11 @@
-if(NOT DEFINED WEBENGINE_ROOT_SOURCE_DIR)
- get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." REALPATH)
-endif()
-find_package(Qt6 ${PROJECT_VERSION} REQUIRED COMPONENTS Gui Network OpenGL Quick)
+find_package(Qt6 ${PROJECT_VERSION} REQUIRED COMPONENTS Gui Network Quick)
find_package(Qt6 ${PROJECT_VERSION} QUIET OPTIONAL_COMPONENTS WebChannel Positioning)
-include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
-
-get_configure_mode(configureMode)
set(qtWebEngineProcessName QtWebEngineProcess)
qt_internal_add_module(WebEngineCore
- ${configureMode}
SOURCES
qtwebenginecoreglobal.cpp qtwebenginecoreglobal.h qtwebenginecoreglobal_p.h
- qwebenginecallback.h qwebenginecallback_p.h
qwebenginecertificateerror.cpp qwebenginecertificateerror.h
qwebengineclientcertificateselection.cpp qwebengineclientcertificateselection.h
qwebengineclientcertificatestore.cpp qwebengineclientcertificatestore.h
@@ -64,8 +56,6 @@ set_target_properties(WebEngineCore PROPERTIES QTWEBENGINEPROCESS_NAME ${qtWebEn
# Chromium included headers are not clean
qt_skip_warnings_are_errors(WebEngineCore)
-make_install_only(WebEngineCore)
-make_config_for_gn(WebEngineCore gn_config)
if(CLANG OR GCC)
target_compile_options(WebEngineCore PRIVATE "-Wno-unused-parameter")
@@ -80,6 +70,98 @@ qt_internal_extend_target(WebEngineCore CONDITION QT_FEATURE_webengine_geolocati
Qt::Positioning
)
+##
+# DOCS
+##
+
qt_internal_add_docs(WebEngineCore
../doc/qtwebengine.qdocconf
)
+
+add_custom_command(
+ OUTPUT chromium_attributions.qdoc
+ COMMAND ${Python2_EXECUTABLE} chromium/tools/licenses.py
+ --file-template ../core/doc/about_credits.tmpl
+ --entry-template ../core/doc/about_credits_entry.tmpl
+ credits ${CMAKE_CURRENT_BINARY_DIR}/chromium_attributions.qdoc
+ DEPENDS ../doc/about_credits.tmpl ../doc/about_credits_entry.tmpl
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty
+ USES_TERMINAL
+)
+add_custom_target(generate_chromium_attributions DEPENDS chromium_attributions.qdoc)
+add_dependencies(generate_docs_WebEngineCore generate_chromium_attributions)
+
+##
+# WEBENGINECORE RESOURCES
+##
+
+set(arch ${CMAKE_SYSTEM_PROCESSOR})
+#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)
+
+get_install_config(config)
+
+foreach(loc ${localeList})
+ get_filename_component(locSourcePath ${buildDir}/${config}/${arch}/qtwebengine_locales/${loc}.pak REALPATH)
+ list(APPEND localeFiles ${locSourcePath})
+endforeach()
+
+foreach(res ${resourceList})
+ get_filename_component(resSourcePath ${buildDir}/${config}/${arch}/${res} REALPATH)
+ list(APPEND resourceFiles ${resSourcePath})
+endforeach()
+
+if (NOT QT_FEATURE_webengine_system_icu)
+ get_filename_component(icuFile ${buildDir}/${config}/${arch}/icudtl.dat REALPATH)
+ list(APPEND resourceFiles ${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 ${buildDir}/${config}/${arch}/QtWebEngineCore.stamp)
+ add_custom_target(generate_resources_${config} DEPENDS ${allResourceFiles})
+else()
+ if(NOT QT_WILL_INSTALL)
+ set(rootPath ${CMAKE_INSTALL_PREFIX})
+ else()
+ if(NOT QT_SUPERBUILD)
+ set(rootPath ${PROJECT_BINARY_DIR})
+ else()
+ set(rootPath ${QT_BUILD_DIR})
+ endif()
+ install(FILES ${localeFiles}
+ DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
+ CONFIGURATIONS ${config}
+ )
+ install(FILES ${resourceFiles}
+ DESTINATION ${INSTALL_DATADIR}/resources
+ CONFIGURATIONS ${config}
+ )
+ endif()
+ addCopyCommand(WebEngineCore "${localeFiles}"
+ ${rootPath}/${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
+ )
+ addCopyCommand(WebEngineCore "${resourceFiles}"
+ ${rootPath}/${INSTALL_DATADIR}/resources
+ )
+endif()
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index 970b8a76..e79bbbae 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -1,14 +1,17 @@
#### Libraries
-find_package(PkgConfig)
-if(PkgConfig_FOUND)
- pkg_check_modules(ALSA alsa IMPORTED_TARGET)
- pkg_check_modules(PULSEAUDIO libpulse>=0.9.10 libpulse-mainloop-glib)
- pkg_check_modules(GIO gio-2.0)
- pkg_check_modules(XDAMAGE xdamage)
-endif()
+if(NOT QT_CONFIGURE_RUNNING)
+ find_package(PkgConfig)
+ if(PkgConfig_FOUND)
+ pkg_check_modules(ALSA alsa IMPORTED_TARGET)
+ pkg_check_modules(PULSEAUDIO libpulse>=0.9.10 libpulse-mainloop-glib)
+ pkg_check_modules(GIO gio-2.0)
+ pkg_check_modules(XDAMAGE xdamage)
+ endif()
-find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS Positioning WebChannel PrintSupport)
+ find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET
+ OPTIONAL_COMPONENTS Positioning WebChannel PrintSupport)
+endif()
#### Tests
@@ -108,15 +111,25 @@ qt_feature("webengine-webrtc-pipewire" PRIVATE
AUTODETECT false
CONDITION QT_FEATURE_webengine_webrtc AND GIO_FOUND
)
-qt_feature_config("webengine-full-debug-info" QMAKE_PRIVATE_CONFIG
- NAME "v8base_debug"
+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_config("webengine-full-debug-info" QMAKE_PRIVATE_CONFIG
- NAME "webcore_debug"
+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_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")
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
deleted file mode 100644
index 2408a586..00000000
--- a/src/core/api/core_api.pro
+++ /dev/null
@@ -1,119 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += webenginecore webenginecore-private
-
-TARGET = qtwebenginecoreapi$$qtPlatformTargetSuffix()
-DESTDIR = $$OUT_PWD/$$getConfigDir()
-
-TEMPLATE = lib
-
-CONFIG += staticlib
-QT += network core-private webenginecoreheaders-private quick qml
-
-qtConfig(webengine-printing-and-pdf): QT += printsupport
-
-# 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_GEN_DIR/third_party/perfetto \
- $$CHROMIUM_GEN_DIR/third_party/perfetto/build_config \
- $$CHROMIUM_SRC_DIR/third_party/abseil-cpp \
- $$CHROMIUM_SRC_DIR/third_party/perfetto/include \
- $$CHROMIUM_SRC_DIR
-
-gcc: QMAKE_CXXFLAGS_WARN_ON = -Wno-unused-parameter
-
-HEADERS = \
- qwebenginecallback.h \
- qwebenginecallback_p.h \
- qwebengineclientcertificatestore.h \
- qtwebenginecoreglobal.h \
- qtwebenginecoreglobal_p.h \
- qwebenginecertificateerror.h \
- qwebenginecookiestore.h \
- qwebenginecookiestore_p.h \
- qwebenginefindtextresult.h \
- qwebenginefullscreenrequest.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 \
- qwebenginecontextmenurequest.h \
- qwebenginecontextmenurequest_p.h \
- qwebenginedownloadrequest.h \
- qwebenginedownloadrequest_p.h \
- qwebengineloadrequest.h \
- qwebenginesettings.h \
- qwebenginescript.h \
- qwebenginescriptcollection.h \
- qwebenginescriptcollection_p.h \
- qwebengineprofile.h \
- qwebengineprofile_p.h \
- qwebengineclientcertificateselection.h \
- qwebenginehistory.h \
- qwebenginehistory_p.h \
- qwebenginepage.h \
- qwebenginepage_p.h
-
-SOURCES = \
- qtwebenginecoreglobal.cpp \
- qwebenginecertificateerror.cpp \
- qwebengineclientcertificatestore.cpp \
- qwebenginecookiestore.cpp \
- qwebenginefindtextresult.cpp \
- qwebenginefullscreenrequest.cpp \
- qwebenginehttprequest.cpp \
- qwebenginemessagepumpscheduler.cpp \
- qwebenginenotification.cpp \
- qwebenginequotarequest.cpp \
- qwebengineregisterprotocolhandlerrequest.cpp \
- qwebengineurlrequestinfo.cpp \
- qwebengineurlrequestjob.cpp \
- qwebengineurlscheme.cpp \
- qwebengineurlschemehandler.cpp \
- qwebenginecontextmenurequest.cpp \
- qwebenginedownloadrequest.cpp \
- qwebengineloadrequest.cpp \
- qwebenginesettings.cpp \
- qwebenginescript.cpp \
- qwebenginescriptcollection.cpp \
- qwebengineprofile.cpp \
- qwebengineclientcertificateselection.cpp \
- qwebenginehistory.cpp \
- qwebenginepage.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 00000000..42dd6b24
--- /dev/null
+++ b/src/core/api/qt_cmdline.cmake
@@ -0,0 +1,31 @@
+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/qtwebenginecoreglobal.h b/src/core/api/qtwebenginecoreglobal.h
index 06778b20..81039a1a 100644
--- a/src/core/api/qtwebenginecoreglobal.h
+++ b/src/core/api/qtwebenginecoreglobal.h
@@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE
Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineVersion() noexcept;
Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineChromiumVersion() noexcept;
+Q_WEBENGINECORE_EXPORT Q_DECL_CONST_FUNCTION const char *qWebEngineChromiumSecurityPatchVersion() noexcept;
QT_END_NAMESPACE
diff --git a/src/core/api/qwebenginecallback_p.h b/src/core/api/qwebenginecallback_p.h
deleted file mode 100644
index 9cc25b7f..00000000
--- 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((QTypeInfo<QWebEngineCallback<x>>::isRelocatable));
-FOR_EACH_TYPE(CHECK_RELOCATABLE)
-#undef CHECK_RELOCATABLE
-
-} // namespace QtWebEngineCore
-
-#endif // QWEBENGINECALLBACK_P_H
diff --git a/src/core/api/qwebenginecertificateerror.h b/src/core/api/qwebenginecertificateerror.h
index d448303c..82ef5017 100644
--- a/src/core/api/qwebenginecertificateerror.h
+++ b/src/core/api/qwebenginecertificateerror.h
@@ -53,7 +53,8 @@ class CertificateErrorController;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineCertificateError {
+class Q_WEBENGINECORE_EXPORT QWebEngineCertificateError
+{
Q_GADGET
Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
Q_PROPERTY(Type type READ type CONSTANT FINAL)
@@ -62,7 +63,7 @@ class Q_WEBENGINECORE_EXPORT QWebEngineCertificateError {
public:
QWebEngineCertificateError(const QWebEngineCertificateError &other);
- QWebEngineCertificateError& operator=(const QWebEngineCertificateError &other);
+ QWebEngineCertificateError &operator=(const QWebEngineCertificateError &other);
~QWebEngineCertificateError();
// Keep this identical to NET_ERROR in net_error_list.h, or add mapping layer.
diff --git a/src/core/api/qwebengineclientcertificateselection.h b/src/core/api/qwebengineclientcertificateselection.h
index 81c626f7..71c85f15 100644
--- a/src/core/api/qwebengineclientcertificateselection.h
+++ b/src/core/api/qwebengineclientcertificateselection.h
@@ -52,7 +52,8 @@ class ClientCertSelectController;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineClientCertificateSelection {
+class Q_WEBENGINECORE_EXPORT QWebEngineClientCertificateSelection
+{
public:
QWebEngineClientCertificateSelection(const QWebEngineClientCertificateSelection &);
~QWebEngineClientCertificateSelection();
diff --git a/src/core/api/qwebengineclientcertificatestore.h b/src/core/api/qwebengineclientcertificatestore.h
index a9282f0f..12ac9c6b 100644
--- a/src/core/api/qwebengineclientcertificatestore.h
+++ b/src/core/api/qwebengineclientcertificatestore.h
@@ -55,7 +55,8 @@ class ProfileAdapter;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineClientCertificateStore {
+class Q_WEBENGINECORE_EXPORT QWebEngineClientCertificateStore
+{
public:
void add(const QSslCertificate &certificate, const QSslKey &privateKey);
diff --git a/src/core/api/qwebenginecontextmenurequest.cpp b/src/core/api/qwebenginecontextmenurequest.cpp
index 3ebb9e15..24ea3a07 100644
--- a/src/core/api/qwebenginecontextmenurequest.cpp
+++ b/src/core/api/qwebenginecontextmenurequest.cpp
@@ -204,16 +204,14 @@ QStringList QWebEngineContextMenuRequest::spellCheckerSuggestions() const
}
/*!
- TODO: needs api in page
+ \property QWebEngineContextMenuRequest::accepted
+ \brief Whether the request is accepted.
*/
bool QWebEngineContextMenuRequest::isAccepted() const
{
return d->m_accepted;
}
-/*!
- TODO: needs api in page
-*/
void QWebEngineContextMenuRequest::setAccepted(bool accepted)
{
d->m_accepted = accepted;
diff --git a/src/core/api/qwebenginecontextmenurequest.h b/src/core/api/qwebenginecontextmenurequest.h
index f075dd06..a5911463 100644
--- a/src/core/api/qwebenginecontextmenurequest.h
+++ b/src/core/api/qwebenginecontextmenurequest.h
@@ -129,8 +129,8 @@ public:
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))
+ 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;
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index f24ac7b2..e8d552ca 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -62,7 +62,6 @@ using namespace QtWebEngineCore;
QWebEngineCookieStorePrivate::QWebEngineCookieStorePrivate(QWebEngineCookieStore *q)
: q_ptr(q)
- , m_nextCallbackId(CallbackDirectory::ReservedCallbackIdsEnd)
, m_deleteSessionCookiesPending(false)
, m_deleteAllCookiesPending(false)
, m_getAllCookiesPending(false)
@@ -76,17 +75,17 @@ 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))
@@ -96,10 +95,10 @@ void QWebEngineCookieStorePrivate::processPendingUserCookies()
return;
for (const CookieData &cookieData : qAsConst(m_pendingUserCookies)) {
- if (cookieData.callbackId == CallbackDirectory::DeleteCookieCallbackId)
+ 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();
@@ -113,26 +112,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;
}
@@ -146,7 +139,7 @@ void QWebEngineCookieStorePrivate::deleteSessionCookies()
return;
}
- delegate->deleteSessionCookies(CallbackDirectory::DeleteSessionCookiesCallbackId);
+ delegate->deleteSessionCookies();
}
void QWebEngineCookieStorePrivate::deleteAllCookies()
@@ -157,7 +150,7 @@ void QWebEngineCookieStorePrivate::deleteAllCookies()
return;
}
- delegate->deleteAllCookies(CallbackDirectory::DeleteAllCookiesCallbackId);
+ delegate->deleteAllCookies();
}
void QWebEngineCookieStorePrivate::getAllCookies()
@@ -167,22 +160,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)
{
@@ -266,8 +246,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);
}
/*!
@@ -294,11 +273,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();
}
@@ -313,10 +289,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();
}
@@ -328,10 +302,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();
}
diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h
index 584275ac..e73222bc 100644
--- a/src/core/api/qwebenginecookiestore.h
+++ b/src/core/api/qwebenginecookiestore.h
@@ -58,7 +58,8 @@ class ProfileAdapter;
QT_BEGIN_NAMESPACE
class QWebEngineCookieStorePrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineCookieStore : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineCookieStore : public QObject
+{
Q_OBJECT
public:
diff --git a/src/core/api/qwebenginecookiestore_p.h b/src/core/api/qwebenginecookiestore_p.h
index e6fa245c..9f26604a 100644
--- a/src/core/api/qwebenginecookiestore_p.h
+++ b/src/core/api/qwebenginecookiestore_p.h
@@ -53,7 +53,6 @@
#include "qtwebenginecoreglobal_p.h"
-#include "qwebenginecallback_p.h"
#include "qwebenginecookiestore.h"
#include <QList>
@@ -66,10 +65,11 @@ class CookieMonsterDelegateQt;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate {
+class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate
+{
Q_DECLARE_PUBLIC(QWebEngineCookieStore)
struct CookieData {
- quint64 callbackId;
+ bool wasDelete;
QNetworkCookie cookie;
QUrl origin;
};
@@ -77,10 +77,8 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate {
QWebEngineCookieStore *q_ptr;
public:
- QtWebEngineCore::CallbackDirectory callbackDirectory;
std::function<bool(const QWebEngineCookieStore::FilterRequest &)> filterCallback;
QList<CookieData> m_pendingUserCookies;
- quint64 m_nextCallbackId;
bool m_deleteSessionCookiesPending;
bool m_deleteAllCookiesPending;
bool m_getAllCookiesPending;
@@ -91,7 +89,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 +97,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/qwebenginedownloadrequest_p.h b/src/core/api/qwebenginedownloadrequest_p.h
index 49980dbb..e158d8ed 100644
--- a/src/core/api/qwebenginedownloadrequest_p.h
+++ b/src/core/api/qwebenginedownloadrequest_p.h
@@ -64,7 +64,8 @@ class WebContentsAdapterClient;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineDownloadRequestPrivate {
+class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineDownloadRequestPrivate
+{
public:
QWebEngineDownloadRequestPrivate(QtWebEngineCore::ProfileAdapter *adapter, const QUrl &url);
~QWebEngineDownloadRequestPrivate();
@@ -98,4 +99,3 @@ public:
QT_END_NAMESPACE
#endif // QWEBENGINEDOWNLOADREQUEST_P_H
-
diff --git a/src/core/api/qwebenginefindtextresult.h b/src/core/api/qwebenginefindtextresult.h
index c4849061..8576dbab 100644
--- a/src/core/api/qwebenginefindtextresult.h
+++ b/src/core/api/qwebenginefindtextresult.h
@@ -52,7 +52,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/qwebenginehistory.h b/src/core/api/qwebenginehistory.h
index 96b257e6..6afb8d8c 100644
--- a/src/core/api/qwebenginehistory.h
+++ b/src/core/api/qwebenginehistory.h
@@ -98,8 +98,8 @@ public:
IconUrlRole,
};
- int rowCount(const QModelIndex& parent = QModelIndex()) const override;
- QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
+ 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();
diff --git a/src/core/api/qwebenginehttprequest.h b/src/core/api/qwebenginehttprequest.h
index e0852088..b302217f 100644
--- a/src/core/api/qwebenginehttprequest.h
+++ b/src/core/api/qwebenginehttprequest.h
@@ -51,7 +51,8 @@ QT_BEGIN_NAMESPACE
class QWebEngineHttpRequestPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineHttpRequest {
+class Q_WEBENGINECORE_EXPORT QWebEngineHttpRequest
+{
public:
enum Method {
Get,
diff --git a/src/core/api/qwebengineloadinginfo.h b/src/core/api/qwebengineloadinginfo.h
index d696fd59..b37dea60 100644
--- a/src/core/api/qwebengineloadinginfo.h
+++ b/src/core/api/qwebengineloadinginfo.h
@@ -96,9 +96,9 @@ public:
int errorCode() const;
private:
- QWebEngineLoadingInfo(const QUrl& url, LoadStatus status,
- bool isErrorPage = false, const QString& errorString = QString(),
- int errorCode = 0, ErrorDomain errorDomain = NoErrorDomain);
+ QWebEngineLoadingInfo(const QUrl &url, LoadStatus status, bool isErrorPage = false,
+ const QString &errorString = QString(), int errorCode = 0,
+ ErrorDomain errorDomain = NoErrorDomain);
class QWebEngineLoadingInfoPrivate;
Q_DECLARE_PRIVATE(QWebEngineLoadingInfo)
QExplicitlySharedDataPointer<QWebEngineLoadingInfoPrivate> d_ptr;
diff --git a/src/core/api/qwebenginemessagepumpscheduler_p.h b/src/core/api/qwebenginemessagepumpscheduler_p.h
index 07b2ca20..46ed62f5 100644
--- a/src/core/api/qwebenginemessagepumpscheduler_p.h
+++ b/src/core/api/qwebenginemessagepumpscheduler_p.h
@@ -59,7 +59,8 @@
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QObject {
+class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QObject
+{
Q_OBJECT
public:
QWebEngineMessagePumpScheduler(std::function<void()> callback);
diff --git a/src/core/api/qwebenginenavigationrequest.h b/src/core/api/qwebenginenavigationrequest.h
index f5136b15..ab098b6a 100644
--- a/src/core/api/qwebenginenavigationrequest.h
+++ b/src/core/api/qwebenginenavigationrequest.h
@@ -96,7 +96,8 @@ Q_SIGNALS:
#endif
private:
- QWebEngineNavigationRequest(const QUrl& url, NavigationType navigationType, bool mainFrame, QObject *parent = nullptr);
+ QWebEngineNavigationRequest(const QUrl &url, NavigationType navigationType, bool mainFrame,
+ QObject *parent = nullptr);
friend class QWebEnginePagePrivate;
friend class QQuickWebEngineViewPrivate;
diff --git a/src/core/api/qwebenginenewwindowrequest.cpp b/src/core/api/qwebenginenewwindowrequest.cpp
index 1322bb4d..70fbd2bb 100644
--- a/src/core/api/qwebenginenewwindowrequest.cpp
+++ b/src/core/api/qwebenginenewwindowrequest.cpp
@@ -59,16 +59,16 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmltype WebEngineNewViewRequest
- \instantiates QQuickWebEngineNewViewRequest
+ \qmltype WebEngineNewWindowRequest
+ \instantiates QWebEngineNewWindowRequest
\inqmlmodule QtWebEngineQuick
- \since QtWebEngine 1.1
+ \since QtWebEngine 1.12
- \brief A utility type for the WebEngineView::newViewRequested signal.
+ \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::newViewRequested
+ \sa WebEngineView::newWindowRequested
*/
/*!
@@ -87,17 +87,17 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty enumeration WebEngineNewViewRequest::DestinationType
+ \qmlproperty enumeration WebEngineNewWindowRequest::DestinationType
Describes how to open a new view:
- \value WebEngineNewViewRequest.InNewWindow
+ \value WebEngineNewWindowRequest.InNewWindow
In a separate window.
- \value WebEngineNewViewRequest.InNewTab
+ \value WebEngineNewWindowRequest.InNewTab
In a tab of the same window.
- \value WebEngineNewViewRequest.InNewDialog
+ \value WebEngineNewWindowRequest.InNewDialog
In a window without a tab bar, toolbar, or URL bar.
- \value WebEngineNewViewRequest.InNewBackgroundTab
+ \value WebEngineNewWindowRequest.InNewBackgroundTab
In a tab of the same window, without hiding the currently visible web engine view.
*/
@@ -121,7 +121,7 @@ QWebEngineNewWindowRequest::~QWebEngineNewWindowRequest()
\brief The type of window that is requested.
*/
/*!
- \qmlproperty WebEngineNewViewRequest::DestinationType WebEngineNewViewRequest::destination
+ \qmlproperty WebEngineNewWindowRequest::DestinationType WebEngineNewWindowRequest::destination
\brief The type of window that is requested.
*/
QWebEngineNewWindowRequest::DestinationType QWebEngineNewWindowRequest::destination() const
@@ -134,7 +134,7 @@ QWebEngineNewWindowRequest::DestinationType QWebEngineNewWindowRequest::destinat
\brief The URL that is requested for the new page.
*/
/*!
- \qmlproperty QUrl WebEngineNewViewRequest::requestedUrl
+ \qmlproperty QUrl WebEngineNewWindowRequest::requestedUrl
\brief The URL that is requested for the new page.
\since QtWebEngine 1.5
*/
@@ -148,7 +148,7 @@ QUrl QWebEngineNewWindowRequest::requestedUrl() const
\brief The size that is requested for the new page.
*/
/*!
- \qmlproperty QRect WebEngineNewViewRequest::requestedGeometry
+ \qmlproperty QRect WebEngineNewWindowRequest::requestedGeometry
\brief The size that is requested for the new page.
\since QtWebEngine 2.0
*/
@@ -164,7 +164,7 @@ QRect QWebEngineNewWindowRequest::requestedGeometry() const
You can use this property to block automatic \e popups.
*/
/*!
- \qmlproperty bool WebEngineNewViewRequest::userInitiated
+ \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.
diff --git a/src/core/api/qwebenginenotification.h b/src/core/api/qwebenginenotification.h
index cd0fe0c6..791f6bb1 100644
--- a/src/core/api/qwebenginenotification.h
+++ b/src/core/api/qwebenginenotification.h
@@ -55,7 +55,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
index c17276a1..c58ef5e7 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -321,6 +321,8 @@ void QWebEnginePagePrivate::loadFinished(QWebEngineLoadingInfo info)
void QWebEnginePagePrivate::didPrintPageToPdf(const QString &filePath, bool success)
{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->pdfPrintingFinished(filePath, success);
if (view)
view->didPrintPageToPdf(filePath, success);
}
@@ -351,20 +353,8 @@ QWebEnginePagePrivate::adoptNewWindow(QSharedPointer<WebContentsAdapter> newWebC
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 (!newPage->d_func()->adoptWebContents(newWebContents.get()))
+ return nullptr;
if (!initialGeometry.isEmpty())
emit newPage->geometryChangeRequested(initialGeometry);
@@ -409,18 +399,12 @@ private:
AdapterPtr adapter;
};
-void QWebEnginePagePrivate::adoptWebContents(WebContentsAdapter *webContents)
+bool QWebEnginePagePrivate::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 newPageRequested signal handler."
- " If a view hasn't been adopted before returning, the request will be invalidated.");
- return;
- }
-
+ Q_ASSERT(webContents);
if (webContents->profileAdapter() && profileAdapter() != webContents->profileAdapter()) {
qWarning("Can not adopt content from a different WebEngineProfile.");
- return;
+ return false;
}
m_isBeingAdopted = true;
@@ -432,6 +416,7 @@ void QWebEnginePagePrivate::adoptWebContents(WebContentsAdapter *webContents)
adapter = webContents->sharedFromThis();
adapter->setClient(this);
+ return true;
}
bool QWebEnginePagePrivate::isBeingAdopted()
@@ -470,8 +455,28 @@ void QWebEnginePagePrivate::didFetchDocumentInnerText(quint64 requestId, const Q
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;
+ if (auto callback = m_pdfResultCallbacks.take(requestId))
+ callback(*(result.data()));
+ return;
+ }
+
if (view)
- view->didPrintPage(requestId, result);
+ 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)
@@ -1666,8 +1671,8 @@ void QWebEnginePagePrivate::requestGeometryChange(const QRect &geometry, const Q
QObject *QWebEnginePagePrivate::dragSource() const
{
-#if !QT_CONFIG(draganddrop)
- return view;
+#if QT_CONFIG(draganddrop)
+ return view->accessibilityParentObject();
#else
return nullptr;
#endif // QT_CONFIG(draganddrop)
@@ -1688,6 +1693,10 @@ void QWebEnginePagePrivate::setToolTip(const QString &toolTipText)
void QWebEnginePagePrivate::printRequested()
{
+ Q_Q(QWebEnginePage);
+ QTimer::singleShot(0, q, [q]() {
+ Q_EMIT q->printRequested();
+ });
if (view)
view->printRequested();
}
@@ -2234,6 +2243,74 @@ QSizeF QWebEnginePage::contentsSize() const
*/
/*!
+ \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().
+
+ 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.
+
+ \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)
@@ -2248,10 +2325,10 @@ void QWebEnginePage::acceptAsNewWindow(QWebEngineNewWindowRequest &request)
return;
}
- if (adapter)
- d->adoptWebContents(adapter.data());
- else
+ if (!adapter)
setUrl(url);
+ else if (!d->adoptWebContents(adapter.data()))
+ return;
QRect geometry = request.requestedGeometry();
if (!geometry.isEmpty())
diff --git a/src/core/api/qwebenginepage.h b/src/core/api/qwebenginepage.h
index 1bdcf653..fcff3ab1 100644
--- a/src/core/api/qwebenginepage.h
+++ b/src/core/api/qwebenginepage.h
@@ -49,6 +49,8 @@
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
#include <QtGui/qaction.h>
+#include <QtGui/qpagelayout.h>
+#include <QtGui/qpageranges.h>
#include <functional>
@@ -73,7 +75,8 @@ class QWebEngineScriptCollection;
class QWebEngineSettings;
class QWebEngineUrlRequestInterceptor;
-class Q_WEBENGINECORE_EXPORT QWebEnginePage : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEnginePage : public QObject
+{
Q_OBJECT
Q_PROPERTY(QString selectedText READ selectedText)
Q_PROPERTY(bool hasSelection READ hasSelection)
@@ -301,6 +304,13 @@ public:
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);
@@ -326,7 +336,7 @@ Q_SIGNALS:
void linkHovered(const QString &url);
void selectionChanged();
- void geometryChangeRequested(const QRect& geom);
+ void geometryChangeRequested(const QRect &geom);
void windowCloseRequested();
void featurePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
@@ -355,6 +365,9 @@ Q_SIGNALS:
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);
@@ -367,11 +380,15 @@ Q_SIGNALS:
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 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:
@@ -393,7 +410,7 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QWebEnginePage::FindFlags)
Q_WEBENGINECORE_EXPORT QDataStream &operator<<(QDataStream &stream,
- const QWebEngineHistory &history);
+ const QWebEngineHistory &history);
Q_WEBENGINECORE_EXPORT QDataStream &operator>>(QDataStream &stream, QWebEngineHistory &history);
QT_END_NAMESPACE
diff --git a/src/core/api/qwebenginepage_p.h b/src/core/api/qwebenginepage_p.h
index f9eb2ad7..4862763a 100644
--- a/src/core/api/qwebenginepage_p.h
+++ b/src/core/api/qwebenginepage_p.h
@@ -70,6 +70,7 @@ class WebContentsAdapter;
}
QT_BEGIN_NAMESPACE
+class QPrinter;
class QWebEngineFindTextResult;
class QWebEngineHistory;
class QWebEnginePage;
@@ -102,7 +103,7 @@ public:
virtual void unhandledKeyEvent(QKeyEvent *event) = 0;
virtual bool passOnFocus(bool reverse) = 0;
virtual QObject *accessibilityParentObject() = 0;
- virtual void didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result) = 0;
+ virtual void didPrintPage(QPrinter *&printer, QSharedPointer<QByteArray> result) = 0;
virtual void didPrintPageToPdf(const QString &filePath, bool success) = 0;
virtual void printRequested() = 0;
};
@@ -122,11 +123,11 @@ public:
void lifecycleStateChanged(LifecycleState state) override;
void recommendedStateChanged(LifecycleState state) override;
void visibleChanged(bool visible) override;
- void titleChanged(const QString&) override;
+ void titleChanged(const QString &) override;
void urlChanged() override;
- void iconChanged(const QUrl&) override;
+ void iconChanged(const QUrl &) override;
void loadProgressChanged(int progress) override;
- void didUpdateTargetURL(const QUrl&) override;
+ void didUpdateTargetURL(const QUrl &) override;
void selectionChanged() override;
void recentlyAudibleChanged(bool recentlyAudible) override;
void renderProcessPidChanged(qint64 pid) override;
@@ -151,14 +152,16 @@ public:
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 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 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;
@@ -194,7 +197,7 @@ public:
void _q_webActionTriggered(bool checked);
void createNewWindow(WindowOpenDisposition disposition, bool userGesture, const QUrl &targetUrl);
- void adoptWebContents(QtWebEngineCore::WebContentsAdapter *webContents);
+ bool adoptWebContents(QtWebEngineCore::WebContentsAdapter *webContents);
QtWebEngineCore::WebContentsAdapter *webContents() { return adapter.data(); }
void recreateFromSerializedHistory(QDataStream &input);
@@ -222,9 +225,13 @@ public:
qreal defaultZoomFactor;
QTimer wasShownTimer;
QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *widget = 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];
};
diff --git a/src/core/api/qwebengineprofile.h b/src/core/api/qwebengineprofile.h
index 84e37b32..5e8deb21 100644
--- a/src/core/api/qwebengineprofile.h
+++ b/src/core/api/qwebengineprofile.h
@@ -62,7 +62,8 @@ class QWebEngineScriptCollection;
class QWebEngineUrlRequestInterceptor;
class QWebEngineUrlSchemeHandler;
-class Q_WEBENGINECORE_EXPORT QWebEngineProfile : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineProfile : public QObject
+{
Q_OBJECT
public:
explicit QWebEngineProfile(QObject *parent = nullptr);
@@ -107,7 +108,7 @@ public:
int httpCacheMaximumSize() const;
void setHttpCacheMaximumSize(int maxSize);
- QWebEngineCookieStore* cookieStore();
+ QWebEngineCookieStore *cookieStore();
void setUrlRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
void clearAllVisitedLinks();
diff --git a/src/core/api/qwebengineprofile_p.h b/src/core/api/qwebengineprofile_p.h
index f3986221..396c8b9b 100644
--- a/src/core/api/qwebengineprofile_p.h
+++ b/src/core/api/qwebengineprofile_p.h
@@ -77,7 +77,7 @@ public:
QWebEngineProfilePrivate(QtWebEngineCore::ProfileAdapter *profileAdapter);
~QWebEngineProfilePrivate();
- QtWebEngineCore::ProfileAdapter* profileAdapter() const;
+ QtWebEngineCore::ProfileAdapter *profileAdapter() const;
QWebEngineSettings *settings() const { return m_settings; }
void downloadDestroyed(quint32 downloadId);
@@ -97,7 +97,7 @@ private:
QWebEngineSettings *m_settings;
QPointer<QtWebEngineCore::ProfileAdapter> m_profileAdapter;
QScopedPointer<QWebEngineScriptCollection> m_scriptCollection;
- QMap<quint32, QPointer<QWebEngineDownloadRequest> > m_ongoingDownloads;
+ QMap<quint32, QPointer<QWebEngineDownloadRequest>> m_ongoingDownloads;
std::function<void(std::unique_ptr<QWebEngineNotification>)> m_notificationPresenter;
};
diff --git a/src/core/api/qwebenginequotarequest.h b/src/core/api/qwebenginequotarequest.h
index 930a13f0..599ca896 100644
--- a/src/core/api/qwebenginequotarequest.h
+++ b/src/core/api/qwebenginequotarequest.h
@@ -52,7 +52,8 @@ class QuotaRequestController;
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)
diff --git a/src/core/api/qwebengineregisterprotocolhandlerrequest.h b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
index b83827c9..86eb3740 100644
--- a/src/core/api/qwebengineregisterprotocolhandlerrequest.h
+++ b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
@@ -52,7 +52,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.h b/src/core/api/qwebenginescript.h
index 03964932..a9b1bb86 100644
--- a/src/core/api/qwebenginescript.h
+++ b/src/core/api/qwebenginescript.h
@@ -51,7 +51,8 @@ class UserScript;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineScript {
+class Q_WEBENGINECORE_EXPORT QWebEngineScript
+{
Q_GADGET
Q_PROPERTY(QString name READ name WRITE setName FINAL)
@@ -115,7 +116,7 @@ private:
QSharedDataPointer<QtWebEngineCore::UserScript> d;
};
-Q_DECLARE_TYPEINFO(QWebEngineScript, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QWebEngineScript, Q_RELOCATABLE_TYPE);
#ifndef QT_NO_DEBUG_STREAM
Q_WEBENGINECORE_EXPORT QDebug operator<<(QDebug, const QWebEngineScript &);
diff --git a/src/core/api/qwebenginescriptcollection.h b/src/core/api/qwebenginescriptcollection.h
index 40ac59e6..7bc9005c 100644
--- a/src/core/api/qwebenginescriptcollection.h
+++ b/src/core/api/qwebenginescriptcollection.h
@@ -48,7 +48,8 @@
QT_BEGIN_NAMESPACE
class QWebEngineScriptCollectionPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineScriptCollection {
+class Q_WEBENGINECORE_EXPORT QWebEngineScriptCollection
+{
public:
~QWebEngineScriptCollection();
diff --git a/src/core/api/qwebenginescriptcollection_p.h b/src/core/api/qwebenginescriptcollection_p.h
index 14bb6dab..62444c78 100644
--- a/src/core/api/qwebenginescriptcollection_p.h
+++ b/src/core/api/qwebenginescriptcollection_p.h
@@ -63,7 +63,8 @@ class UserResourceControllerHost;
} // namespace
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineScriptCollectionPrivate {
+class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineScriptCollectionPrivate
+{
public:
QWebEngineScriptCollectionPrivate(QtWebEngineCore::UserResourceControllerHost *, QSharedPointer<QtWebEngineCore::WebContentsAdapter> = QSharedPointer<QtWebEngineCore::WebContentsAdapter>());
int count() const;
diff --git a/src/core/api/qwebenginesettings.h b/src/core/api/qwebenginesettings.h
index 4ab364d1..ff193561 100644
--- a/src/core/api/qwebenginesettings.h
+++ b/src/core/api/qwebenginesettings.h
@@ -50,7 +50,8 @@ class WebEngineSettings;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineSettings {
+class Q_WEBENGINECORE_EXPORT QWebEngineSettings
+{
public:
enum FontFamily {
StandardFont,
@@ -110,8 +111,6 @@ public:
AllowAllUnknownUrlSchemes
};
- //TODO: see if we still need it
- //static QWebEngineSettings *defaultSettings();
public:
~QWebEngineSettings();
void setFontFamily(FontFamily which, const QString &family);
diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h
index 7c12f186..65838663 100644
--- a/src/core/api/qwebengineurlrequestinfo.h
+++ b/src/core/api/qwebengineurlrequestinfo.h
@@ -53,7 +53,8 @@ QT_BEGIN_NAMESPACE
class QWebEngineUrlRequestInfoPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInfo {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInfo
+{
public:
enum ResourceType {
ResourceTypeMainFrame = 0, // top level page
diff --git a/src/core/api/qwebengineurlrequestinfo_p.h b/src/core/api/qwebengineurlrequestinfo_p.h
index 206104ec..05a89c5c 100644
--- a/src/core/api/qwebengineurlrequestinfo_p.h
+++ b/src/core/api/qwebengineurlrequestinfo_p.h
@@ -65,7 +65,8 @@ class URLRequest;
QT_BEGIN_NAMESPACE
-class QWebEngineUrlRequestInfoPrivate {
+class QWebEngineUrlRequestInfoPrivate
+{
Q_DECLARE_PUBLIC(QWebEngineUrlRequestInfo)
public:
QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource,
diff --git a/src/core/api/qwebengineurlrequestinterceptor.h b/src/core/api/qwebengineurlrequestinterceptor.h
index 6903a25f..a96ded1a 100644
--- a/src/core/api/qwebengineurlrequestinterceptor.h
+++ b/src/core/api/qwebengineurlrequestinterceptor.h
@@ -47,7 +47,8 @@
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject
+{
Q_OBJECT
Q_DISABLE_COPY(QWebEngineUrlRequestInterceptor)
public:
diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h
index 6d4a9e73..c7128fd3 100644
--- a/src/core/api/qwebengineurlrequestjob.h
+++ b/src/core/api/qwebengineurlrequestjob.h
@@ -55,7 +55,8 @@ QT_BEGIN_NAMESPACE
class QIODevice;
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestJob : public QObject {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestJob : public QObject
+{
Q_OBJECT
public:
~QWebEngineUrlRequestJob();
diff --git a/src/core/api/qwebengineurlscheme.h b/src/core/api/qwebengineurlscheme.h
index ecac4418..e934f39d 100644
--- a/src/core/api/qwebengineurlscheme.h
+++ b/src/core/api/qwebengineurlscheme.h
@@ -54,7 +54,8 @@ QT_BEGIN_NAMESPACE
class QWebEngineUrlSchemePrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlScheme {
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlScheme
+{
Q_GADGET
public:
enum class Syntax {
diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h
index 91ee2169..c1625d9d 100644
--- a/src/core/api/qwebengineurlschemehandler.h
+++ b/src/core/api/qwebengineurlschemehandler.h
@@ -48,7 +48,8 @@ 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 = nullptr);
diff --git a/src/core/certificate_error_controller.cpp b/src/core/certificate_error_controller.cpp
index 0c0137ca..d9a07ae4 100644
--- a/src/core/certificate_error_controller.cpp
+++ b/src/core/certificate_error_controller.cpp
@@ -118,8 +118,10 @@ CertificateErrorController::CertificateErrorController(
, m_requestUrl(toQt(request_url))
, m_overridable(!IsCertErrorFatal(cert_error) && !strict_enforcement)
{
- if (m_overridable)
- m_callback = std::move(cb);
+ // 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()) {
m_validExpiry = toQt(cert->valid_expiry());
m_certificateChain = toCertificateChain(cert);
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index d5d1abcd..026653cb 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -127,7 +127,7 @@ void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const O
// Copy text and SourceTag to the selection clipboard.
WritePortableRepresentations(ui::ClipboardBuffer::kSelection,
ObjectMap(text_iter, text_iter + 1),
- std::move(data_src));
+ nullptr);
}
}
m_dataSrc[type] = std::move(data_src);
diff --git a/src/core/compositor/compositor_resource_fence.cpp b/src/core/compositor/compositor_resource_fence.cpp
index 42528469..d03e260d 100644
--- a/src/core/compositor/compositor_resource_fence.cpp
+++ b/src/core/compositor/compositor_resource_fence.cpp
@@ -41,7 +41,6 @@
#include "ozone/gl_surface_qt.h"
#include "ui/gl/gl_context.h"
-#include <QtGui/private/qtguiglobal_p.h>
#include <QtGui/qopenglcontext.h>
#ifndef GL_TIMEOUT_IGNORED
diff --git a/src/core/compositor/display_overrides.cpp b/src/core/compositor/display_overrides.cpp
index 4636d7a3..d4176527 100644
--- a/src/core/compositor/display_overrides.cpp
+++ b/src/core/compositor/display_overrides.cpp
@@ -66,10 +66,14 @@ viz::OutputSurfaceProviderImpl::CreateSoftwareOutputSurface()
std::unique_ptr<viz::SkiaOutputDevice>
viz::SkiaOutputSurfaceImplOnGpu::CreateOutputDevice()
{
+#if QT_CONFIG(opengl)
return std::make_unique<QtWebEngineCore::DisplaySkiaOutputDevice>(
context_state_,
shared_gpu_deps_->memory_tracker(),
GetDidSwapBuffersCompleteCallback());
+#else
+ return nullptr;
+#endif // QT_CONFIG(opengl)
}
void gpu::InProcessCommandBuffer::GetTextureQt(
diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp
index 98c104dd..b811449c 100644
--- a/src/core/compositor/display_software_output_surface.cpp
+++ b/src/core/compositor/display_software_output_surface.cpp
@@ -99,9 +99,12 @@ void DisplaySoftwareOutputSurface::Device::Resize(const gfx::Size &sizeInPixels,
void DisplaySoftwareOutputSurface::Device::OnSwapBuffers(SwapBuffersCallback swap_ack_callback)
{
- QMutexLocker locker(&m_mutex);
- m_taskRunner = base::ThreadTaskRunnerHandle::Get();
- m_swapCompletionCallback = std::move(swap_ack_callback);
+ { // 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::ThreadTaskRunnerHandle::Get();
+ m_swapCompletionCallback = std::move(swap_ack_callback);
+ }
+
if (auto obs = observer())
obs->readyToSwap();
}
diff --git a/src/core/config/common.pri b/src/core/config/common.pri
deleted file mode 100644
index d9d64e76..00000000
--- a/src/core/config/common.pri
+++ /dev/null
@@ -1,48 +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
-}
-
-qtConfig(webengine-proprietary-codecs) {
- gn_args += proprietary_codecs=true ffmpeg_branding=\"Chrome\"
- qtConfig(webengine-webrtc) {
- gn_args += rtc_use_h264=true
- }
-} 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-nodejs10): gn_args += use_rollup=false
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
deleted file mode 100644
index 3e490a0d..00000000
--- a/src/core/config/linux.pri
+++ /dev/null
@@ -1,44 +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-webrtc): qtConfig(webengine-webrtc-pipewire): gn_args += rtc_use_pipewire=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
-}
diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
deleted file mode 100644
index 9543daf9..00000000
--- 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 9543daf9..00000000
--- 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/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index 23b50064..2ba599e4 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -12,8 +12,11 @@ import("//chrome/chrome_repack_locales.gni")
import("//extensions/buildflags/buildflags.gni")
import("//ui/ozone/ozone.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", "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"],"list lines")
+ [ "-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",
[
@@ -86,7 +89,7 @@ config("cpp17_config") {
}
shared_library("QtWebEngineCore") {
- cmake_config = "@GN_CONFIG@"
+ rsp_types = [ "objects", "archives", "libs" ]
configs += [
":cpp17_config",
":QtWebEngineCore_config",
@@ -614,7 +617,7 @@ if (enable_extensions) {
if (enable_spellcheck) {
shared_library("convert_dict") {
- cmake_config = "@GN_CONFIG@"
+ rsp_types = [ "objects", "archives", "libs" ]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [
"//chrome/tools/convert_dict:lib",
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index f580e6f7..f8d1afe1 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -1086,13 +1086,9 @@ void ContentBrowserClientQt::RegisterNonNetworkSubresourceURLLoaderFactories(int
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.
bool install_file_scheme = 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 (web_contents) {
+ const auto *settings = static_cast<WebContentsDelegateQt *>(web_contents->GetResponsibleWebContents()->GetDelegate())->webEngineSettings();
if (settings->testAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls)) {
for (const auto &local_scheme : url::GetLocalSchemes()) {
if (url.SchemeIs(local_scheme)) {
diff --git a/src/core/core.pro b/src/core/core.pro
deleted file mode 100644
index f2d3fd30..00000000
--- 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 df938232..00000000
--- a/src/core/core_chromium.pri
+++ /dev/null
@@ -1,352 +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_messages.cpp \
- compositor/compositor.cpp \
- compositor/content_gpu_client_qt.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_share_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 \
- render_widget_host_view_qt_delegate_client.cpp \
- renderer/content_renderer_client_qt.cpp \
- renderer/content_settings_observer_qt.cpp \
- renderer/render_frame_observer_qt.cpp \
- renderer/web_engine_page_render_frame.cpp \
- renderer/render_configuration.cpp \
- renderer/user_resource_controller.cpp \
- renderer_host/web_engine_page_host.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.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 \
- compositor/compositor.h \
- compositor/content_gpu_client_qt.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 \
- 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_share_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 \
- render_widget_host_view_qt_delegate_client.h \
- renderer/content_renderer_client_qt.h \
- renderer/content_settings_observer_qt.h \
- renderer/render_frame_observer_qt.h \
- renderer/web_engine_page_render_frame.h \
- renderer/render_configuration.h \
- renderer/user_resource_controller.h \
- renderer_host/web_engine_page_host.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_host_factory_qt.cpp \
- renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp \
- renderer/pepper/pepper_renderer_host_factory_qt.cpp \
- renderer/plugins/loadable_plugin_placeholder_qt.cpp
-
- HEADERS += \
- renderer_host/pepper/pepper_host_factory_qt.h \
- renderer_host/pepper/pepper_isolated_file_system_message_filter.h \
- renderer/pepper/pepper_renderer_host_factory_qt.h \
- renderer/plugins/loadable_plugin_placeholder_qt.h
-}
-
-qtConfig(webengine-printing-and-pdf) {
-
- SOURCES += \
- printing/print_view_manager_base_qt.cpp \
- printing/print_view_manager_qt.cpp \
- printing/printer_worker.cpp \
- renderer/print_web_view_helper_delegate_qt.cpp
-
- HEADERS += \
- printing/print_view_manager_base_qt.h \
- printing/print_view_manager_qt.h \
- printing/printer_worker.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
- HEADERS += \
- compositor/compositor_resource_fence.h \
- compositor/display_gl_output_surface.h
-
- macos {
- HEADERS+=macos_context_type_helper.h
- SOURCES+=macos_context_type_helper.mm
- }
-}
-
-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_host_delegate_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/messaging_delegate_qt.cpp \
- extensions/mime_handler_view_guest_delegate_qt.cpp \
- extensions/pdf_iframe_navigation_throttle_qt.cpp \
- extensions/plugin_service_filter_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_host_delegate_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/messaging_delegate_qt.h \
- extensions/mime_handler_view_guest_delegate_qt.h \
- extensions/pdf_iframe_navigation_throttle_qt.h \
- extensions/plugin_service_filter_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 9e06b37f..00000000
--- a/src/core/core_common.pri
+++ /dev/null
@@ -1,21 +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
-qtConfig(webengine-printing-and-pdf): QT += printsupport
-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
-
-# QtBase requires C++17
-CONFIG += c++17
-
diff --git a/src/core/core_generator.pro b/src/core/core_generator.pro
deleted file mode 100644
index 935c653a..00000000
--- 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 2b8f2e18..00000000
--- 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 cd5352eb..00000000
--- 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 520b452f..00000000
--- a/src/core/core_module.pro
+++ /dev/null
@@ -1,120 +0,0 @@
-MODULE = webenginecore
-
-include(core_common.pri)
-include($${QTWEBENGINE_ROOT}/src/buildtools/config/linking.pri)
-
-api_library_name = qtwebenginecoreapi$$qtPlatformTargetSuffix()
-api_library_path = $$OUT_PWD/api/$$getConfigDir()
-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
-}
-
-# Needed to set a CFBundleIdentifier
-QMAKE_INFO_PLIST = Info_mac.plist
-
-# 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 {
- !ccache:!use_gold_linker:!use_lld_linker {
- QMAKE_LINK="ulimit -n 4096 && $$QMAKE_LINK"
- QMAKE_LINK_SHLIB="ulimit -n 4096 && $$QMAKE_LINK_SHLIB"
- }
- 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 9c8e2080..00000000
--- 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/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 440c52d3..81701b63 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -296,7 +296,7 @@ void DevToolsFrontendQt::ReadyToCommitNavigation(content::NavigationHandle *navi
// 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
+ else if (!m_frontendHost)
m_frontendHost = content::DevToolsFrontendHost::Create(
frame,
base::Bind(&DevToolsFrontendQt::HandleMessageFromDevToolsFrontend,
@@ -488,6 +488,8 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"),
base::NullCallback());
} else if (method == "reattach") {
+ if (!m_agentHost)
+ return;
m_agentHost->DetachClient(this);
m_agentHost->AttachClient(this);
} else if (method == "inspectedURLChanged" && params && params->GetSize() >= 1) {
diff --git a/tools/about_credits.tmpl b/src/core/doc/about_credits.tmpl
index 57fae9e7..57fae9e7 100644
--- a/tools/about_credits.tmpl
+++ b/src/core/doc/about_credits.tmpl
diff --git a/tools/about_credits_entry.tmpl b/src/core/doc/about_credits_entry.tmpl
index 2bb9cff4..2bb9cff4 100644
--- a/tools/about_credits_entry.tmpl
+++ b/src/core/doc/about_credits_entry.tmpl
diff --git a/src/core/doc/qtwebengine.qdocconf b/src/core/doc/qtwebengine.qdocconf
index f81c706a..6a3bd9ca 100644
--- a/src/core/doc/qtwebengine.qdocconf
+++ b/src/core/doc/qtwebengine.qdocconf
@@ -13,10 +13,6 @@ 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
diff --git a/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc b/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
index 94e26c9c..43421baf 100644
--- a/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
+++ b/src/core/doc/snippets/qtwebenginecore_build_snippet.qdoc
@@ -33,3 +33,8 @@ QT += webenginecore
//! [1]
#include <QtWebEngineCore>
//! [1]
+
+//! [2]
+find_package(Qt6 COMPONENTS WebEngineCore REQUIRED)
+target_link_libraries(target PRIVATE Qt::WebEngineCore)
+//! [2]
diff --git a/src/webenginequick/doc/src/external-resources.qdoc b/src/core/doc/src/external-resources.qdoc
index 24648b84..df6c40c4 100644
--- a/src/webenginequick/doc/src/external-resources.qdoc
+++ b/src/core/doc/src/external-resources.qdoc
@@ -144,3 +144,19 @@
\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 00000000..1ab3a848
--- /dev/null
+++ b/src/core/doc/src/qt6-changes.qdoc
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 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-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.
+
+ \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/webenginequick/doc/src/qtwebengine-debugging.qdoc b/src/core/doc/src/qtwebengine-debugging.qdoc
index f84cca31..f84cca31 100644
--- a/src/webenginequick/doc/src/qtwebengine-debugging.qdoc
+++ b/src/core/doc/src/qtwebengine-debugging.qdoc
diff --git a/src/webenginequick/doc/src/qtwebengine-deploying.qdoc b/src/core/doc/src/qtwebengine-deploying.qdoc
index 7b9f3fd4..7b9f3fd4 100644
--- a/src/webenginequick/doc/src/qtwebengine-deploying.qdoc
+++ b/src/core/doc/src/qtwebengine-deploying.qdoc
diff --git a/src/webenginequick/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index 24bc9d7a..29ec002e 100644
--- a/src/webenginequick/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -281,8 +281,7 @@
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
+ 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:
@@ -302,51 +301,6 @@
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
diff --git a/src/webenginequick/doc/src/qtwebengine-index.qdoc b/src/core/doc/src/qtwebengine-index.qdoc
index f668cf87..4c1dedaa 100644
--- a/src/webenginequick/doc/src/qtwebengine-index.qdoc
+++ b/src/core/doc/src/qtwebengine-index.qdoc
@@ -49,10 +49,16 @@
\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 Examples}
+ \li \l{Qt WebEngine Quick Examples}
\li \l{Qt WebEngine Widgets Examples}
\endlist
diff --git a/src/webenginequick/doc/src/qtwebengine-modules.qdoc b/src/core/doc/src/qtwebengine-modules.qdoc
index 759284ad..759284ad 100644
--- a/src/webenginequick/doc/src/qtwebengine-modules.qdoc
+++ b/src/core/doc/src/qtwebengine-modules.qdoc
diff --git a/src/webenginequick/doc/src/qtwebengine-overview.qdoc b/src/core/doc/src/qtwebengine-overview.qdoc
index 099142f8..d7d5b50d 100644
--- a/src/webenginequick/doc/src/qtwebengine-overview.qdoc
+++ b/src/core/doc/src/qtwebengine-overview.qdoc
@@ -89,7 +89,7 @@
\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 87.0.4280, with additional security
+ This version of \QWE is based on Chromium version 90.0.4430, with additional security
fixes from newer versions.
\section2 Qt WebEngine Process
@@ -128,10 +128,10 @@
\code
int main(int argc, char **argv)
{
- QApplication app(argc, argv);
-
QtWebEngineQuick::initialize();
+ QApplication app(argc, argv);
+
QMainWindow window;
window.show();
@@ -171,7 +171,7 @@
The following sample QML application loads a web page using the \l{WebEngineView::}{url}
property:
- \quotefromfile webengine/minimal/main.qml
+ \quotefromfile webenginequick/minimal/main.qml
\skipto import
\printuntil /^\}/
diff --git a/src/webenginequick/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
index 08eaf72b..c9426295 100644
--- a/src/webenginequick/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -232,7 +232,5 @@
\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}.
-
+ workaround is described in \l {Fullscreen OpenGL Based Windows}.
*/
diff --git a/src/core/doc/src/qtwebenginecore-index.qdoc b/src/core/doc/src/qtwebenginecore-index.qdoc
index 692e33d1..0fdde225 100644
--- a/src/core/doc/src/qtwebenginecore-index.qdoc
+++ b/src/core/doc/src/qtwebenginecore-index.qdoc
@@ -44,6 +44,11 @@
\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 c976d024..033d8111 100644
--- a/src/core/doc/src/qtwebenginecore-module.qdoc
+++ b/src/core/doc/src/qtwebenginecore-module.qdoc
@@ -33,6 +33,8 @@
\since 5.6
\ingroup qtwebengine-modules
\ingroup modules
+ \qtvariable webenginecore
+ \qtcmakepackage WebEngineCore
To include the definitions of the module's classes, use the
following directive:
@@ -44,10 +46,16 @@
\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/webenginequick/doc/src/qwebengine-licensing.qdoc b/src/core/doc/src/qwebengine-licensing.qdoc
index f6a0a6c3..f6a0a6c3 100644
--- a/src/webenginequick/doc/src/qwebengine-licensing.qdoc
+++ b/src/core/doc/src/qwebengine-licensing.qdoc
diff --git a/src/core/doc/src/qwebenginesettings_lgpl.qdoc b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
index 7c6ccd3d..bfe2713a 100644
--- a/src/core/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
@@ -97,13 +97,11 @@
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
+ remote resources that would normally be blocked, since remote resources are
+ considered cross-origin for a local document. 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.
+ Note that disabling this setting does not prevent media elements in local files from
+ accessing remote content. Disabled by default.
\value XSSAuditingEnabled
Obsolete and has no effect.
\value SpatialNavigationEnabled
@@ -114,7 +112,8 @@
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.
+ 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
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index b7b74460..58f6507a 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -204,8 +204,16 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
QFileInfo suggestedFile(info.path);
if (info.accepted && !suggestedFile.absoluteDir().mkpath(suggestedFile.absolutePath())) {
+#if defined(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(OS_WIN)
+ }
+#endif
}
if (!info.accepted) {
diff --git a/src/core/favicon_service_factory_qt.cpp b/src/core/favicon_service_factory_qt.cpp
index 89888248..6810927c 100644
--- a/src/core/favicon_service_factory_qt.cpp
+++ b/src/core/favicon_service_factory_qt.cpp
@@ -84,8 +84,6 @@ HistoryServiceFactoryQt::GetForBrowserContext(content::BrowserContext *context)
if (context->IsOffTheRecord())
return nullptr;
- if (!base::PathExists(context->GetPath()))
- return nullptr;
return static_cast<history::HistoryService *>(
GetInstance()->GetServiceForBrowserContext(context, true));
@@ -115,7 +113,6 @@ KeyedService *
HistoryServiceFactoryQt::BuildServiceInstanceFor(content::BrowserContext *context) const
{
Q_ASSERT(!context->IsOffTheRecord());
- Q_ASSERT(base::PathExists(context->GetPath()));
std::unique_ptr<history::HistoryService> historyService(
new history::HistoryService(std::make_unique<HistoryClientQt>(), nullptr));
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 537a0150..051b877a 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -92,6 +92,9 @@ FilePickerController::FilePickerController(FilePickerControllerPrivate *priv, QO
FilePickerController::~FilePickerController()
{
+ if (!m_isHandled) {
+ rejected();
+ }
delete d_ptr;
}
@@ -241,6 +244,7 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
else
d_ptr->fileSystemAccessDialogListener->MultiFilesSelected(files, nullptr);
}
+ m_isHandled = true;
}
QStringList FilePickerController::acceptedMimeTypes() const
diff --git a/src/core/file_picker_controller.h b/src/core/file_picker_controller.h
index bba0bae3..ec3b5ba1 100644
--- a/src/core/file_picker_controller.h
+++ b/src/core/file_picker_controller.h
@@ -85,6 +85,9 @@ public Q_SLOTS:
private:
void filesSelectedInChooser(const QStringList &filesList);
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 QtWebEngineCore
diff --git a/src/core/find_text_helper.h b/src/core/find_text_helper.h
index cdea3c2f..f795731e 100644
--- a/src/core/find_text_helper.h
+++ b/src/core/find_text_helper.h
@@ -52,8 +52,12 @@
#define FIND_TEXT_HELPER_H
#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
-#include <QtWebEngineCore/private/qwebenginecallback_p.h>
+
#include <QJSValue>
+#include <QMap>
+#include <QString>
+
+#include <functional>
namespace content {
class WebContents;
diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro
deleted file mode 100644
index 4688ea59..00000000
--- a/src/core/gn_run.pro
+++ /dev/null
@@ -1,68 +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
-
-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/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 2661c2bb..c9256f8a 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -194,6 +194,7 @@ content::DesktopMediaID getDefaultScreenId()
int numMonitors = 0;
XRRMonitorInfo *monitors = getMonitors(display, rootWindow, true, &numMonitors);
+ auto cleanup = qScopeGuard([&] () { freeMonitors(monitors); });
if (numMonitors > 0)
return content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, monitors[0].name);
#endif // !defined(WEBRTC_USE_X11)
diff --git a/src/core/native_web_keyboard_event_qt.cpp b/src/core/native_web_keyboard_event_qt.cpp
index edd27cce..c90b3c9e 100644
--- a/src/core/native_web_keyboard_event_qt.cpp
+++ b/src/core/native_web_keyboard_event_qt.cpp
@@ -95,7 +95,10 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent(const NativeWebKeyboardEvent& oth
{
}
-NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent& other) {
+NativeWebKeyboardEvent &NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent &other)
+{
+ if (this == &other)
+ return *this;
WebKeyboardEvent::operator=(other);
DestroyEvent(os_event);
os_event = CopyEvent(other.os_event);
diff --git a/src/core/net/client_cert_override.cpp b/src/core/net/client_cert_override.cpp
index 9c2ff31d..4f7ae665 100644
--- a/src/core/net/client_cert_override.cpp
+++ b/src/core/net/client_cert_override.cpp
@@ -141,22 +141,19 @@ void ClientCertOverrideStore::GetClientCerts(const net::SSLCertRequestInfo &cert
{
#if QT_CONFIG(ssl)
// Access the user-provided data from the UI thread, but return on whatever thread this is.
- if (base::PostTaskAndReplyWithResult(
+ bool ok = 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
+ 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
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index 9f703bcb..2fbacd73 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -125,23 +125,19 @@ 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::CookieInclusionStatus inclusion;
auto canonCookie = net::CanonicalCookie::Create(gurl, cookie_line, base::Time::Now(), base::nullopt, &inclusion);
if (!inclusion.IsInclude()) {
@@ -151,7 +147,7 @@ void CookieMonsterDelegateQt::setCookie(quint64 callbackId, const QNetworkCookie
net::CookieOptions options;
options.set_include_httponly();
options.set_same_site_cookie_context(net::CookieOptions::SameSiteCookieContext::MakeInclusiveForSet());
- m_mojoCookieManager->SetCanonicalCookie(*canonCookie.get(), gurl, options, std::move(callback));
+ m_mojoCookieManager->SetCanonicalCookie(*canonCookie.get(), gurl, options, net::CookieStore::SetCookiesCallback());
}
void CookieMonsterDelegateQt::deleteCookie(const QNetworkCookie &cookie, const QUrl &origin)
@@ -167,27 +163,23 @@ 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)
@@ -265,23 +257,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::CookieAccessResult status)
-{
- if (m_client)
- m_client->d_func()->onSetCallbackResult(callbackId, status.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 9078bcd5..4359119f 100644
--- a/src/core/net/cookie_monster_delegate_qt.h
+++ b/src/core/net/cookie_monster_delegate_qt.h
@@ -95,11 +95,11 @@ public:
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);
@@ -111,11 +111,6 @@ public:
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::CookieAccessResult status);
- void DeleteCookiesCallbackOnUIThread(qint64 callbackId, uint numCookies);
};
}
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index c945ee4d..6505e550 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -47,8 +47,11 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_switches.h"
#include "net/http/http_status_code.h"
+#include "services/network/public/cpp/cors/cors.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h"
+#include "url/url_util.h"
#include "api/qwebengineurlrequestinfo_p.h"
#include "type_conversion.h"
@@ -164,6 +167,7 @@ private:
const uint64_t request_id_;
const int32_t routing_id_;
const uint32_t options_;
+ bool allowed_cors_ = true;
// If the |target_loader_| called OnComplete with an error this stores it.
// That way the destructor can send it to OnReceivedError if safe browsing
@@ -205,12 +209,37 @@ InterceptedRequest::InterceptedRequest(ProfileAdapter *profile_adapter,
, target_factory_(std::move(target_factory))
, weak_factory_(this)
{
+ const bool disable_web_security = base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebSecurity);
current_response_ = network::mojom::URLResponseHead::New();
+ current_response_->response_type = network::cors::CalculateResponseType(
+ request_.mode,
+ disable_web_security || (
+ request_.request_initiator && request_.request_initiator->IsSameOriginWith(url::Origin::Create(request_.url))));
// 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();
+ std::string fromScheme = request_.request_initiator->GetTupleOrPrecursorTupleIfOpaque().scheme();
+ if (base::Contains(localSchemes, fromScheme)) {
+ content::WebContents *wc = webContents();
+ std::string toScheme = request_.url.scheme();
+ // local schemes must have universal access, or be accessing something local and have local access.
+ if (fromScheme != toScheme) {
+ // note allow_file_access_from_file_urls maps to LocalContentCanAccessFileUrls in our API
+ // and allow_universal_access_from_file_urls to LocalContentCanAccessRemoteUrls, so we are
+ // using them as proxies for our API here.
+ if (toScheme == "file")
+ allowed_cors_ = wc && wc->GetOrCreateWebPreferences().allow_file_access_from_file_urls;
+ else if (!base::Contains(localSchemes, toScheme))
+ allowed_cors_ = wc && wc->GetOrCreateWebPreferences().allow_universal_access_from_file_urls;
+ else
+ allowed_cors_ = true; // We should think about this for future patches
+ }
+ }
+ }
}
InterceptedRequest::~InterceptedRequest()
@@ -247,6 +276,14 @@ void InterceptedRequest::Restart()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ // This is a CORS check on the from URL, the normal check on the to URL is applied later
+ if (!allowed_cors_ && current_response_->response_type == network::mojom::FetchResponseType::kCors) {
+ target_client_->OnComplete(network::URLLoaderCompletionStatus(
+ network::CorsErrorStatus(network::mojom::CorsError::kCorsDisabledScheme)));
+ 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.
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp
index f734db64..b5758334 100644
--- a/src/core/net/url_request_custom_job_proxy.cpp
+++ b/src/core/net/url_request_custom_job_proxy.cpp
@@ -96,7 +96,7 @@ void URLRequestCustomJobProxy::reply(std::string mimeType, QIODevice *device)
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;
diff --git a/src/core/ozone/BUILD.gn b/src/core/ozone/BUILD.gn
index 016d0a71..e0f9b8a4 100644
--- a/src/core/ozone/BUILD.gn
+++ b/src/core/ozone/BUILD.gn
@@ -2,6 +2,13 @@
# 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("xkbcommon") {
+ packages = [ "xkbcommon" ]
+ }
+}
source_set("qt") {
sources = [
@@ -19,8 +26,13 @@ source_set("qt") {
]
defines = [ "OZONE_IMPLEMENTATION" ]
-
+ libs = []
if (use_xkbcommon) {
- libs = [ "xkbfile" ]
+ configs += [ ":xkbcommon" ]
+ libs += [ "xkbfile" ]
+ }
+
+ 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 55497751..1dd7d8f6 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -42,6 +42,7 @@
#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"
@@ -154,7 +155,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");
}
@@ -175,7 +176,7 @@ QFunctionPointer GLContextHelper::getEglGetProcAddress()
void *GLContextHelper::getGlxPlatformInterface()
{
-#if QT_CONFIG(opengl) && defined(USE_GLX)
+#if QT_CONFIG(xcb_glx)
if (QOpenGLContext *context = qt_gl_global_share_context())
return context->nativeInterface<QNativeInterface::QGLXContext>();
#endif
diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp
index 5b42acd9..8dbacfb2 100644
--- a/src/core/ozone/ozone_platform_qt.cpp
+++ b/src/core/ozone/ozone_platform_qt.cpp
@@ -164,7 +164,17 @@ static std::string getCurrentKeyboardLayout()
if (XkbGetState(dpy, XkbUseCoreKbd, &state) != 0)
return std::string();
- XkbRF_VarDefsRec vdr;
+ 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();
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index b8e18e7d..8d2d1bfd 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -383,6 +383,11 @@ void PrintViewManagerBaseQt::GetDefaultPrintSettings(GetDefaultPrintSettingsCall
void PrintViewManagerBaseQt::PrintingFailed(int32_t cookie)
{
+ // Note: Not redundant with cookie checks in the same method in other parts of
+ // the class hierarchy.
+ if (!IsValidCookie(cookie))
+ return;
+
PrintManager::PrintingFailed(cookie);
ReleasePrinterQuery();
diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index 0f218ab6..d28e789e 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -58,9 +58,7 @@
#include <QTextFormat>
#include <QVariant>
-#include <private/qguiapplication_p.h>
-#include <qpa/qplatforminputcontext.h>
-#include <qpa/qplatformintegration.h>
+#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qinputcontrol_p.h>
namespace QtWebEngineCore {
@@ -202,11 +200,6 @@ RenderWidgetHostViewQtDelegateClient::RenderWidgetHostViewQtDelegateClient(
: m_rwhv(rwhv)
{
Q_ASSERT(rwhv);
-
- const QPlatformInputContext *context =
- QGuiApplicationPrivate::platformIntegration()->inputContext();
- m_imeHasHiddenTextCapability =
- context && context->hasCapability(QPlatformInputContext::HiddenTextCapability);
}
Compositor::Id RenderWidgetHostViewQtDelegateClient::compositorId()
@@ -365,17 +358,8 @@ bool RenderWidgetHostViewQtDelegateClient::forwardEvent(QEvent *event)
QVariant RenderWidgetHostViewQtDelegateClient::inputMethodQuery(Qt::InputMethodQuery query)
{
switch (query) {
- case Qt::ImEnabled: {
- ui::TextInputType type = m_rwhv->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::ImEnabled:
+ return QVariant(m_rwhv->getTextInputType() != ui::TEXT_INPUT_TYPE_NONE);
case Qt::ImFont:
// TODO: Implement this
return QVariant();
@@ -733,7 +717,8 @@ void RenderWidgetHostViewQtDelegateClient::handleGestureEvent(QNativeGestureEven
{
const Qt::NativeGestureType type = event->gestureType();
// These are the only supported gestures by Chromium so far.
- if (type == Qt::ZoomNativeGesture || type == Qt::SmartZoomNativeGesture) {
+ 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);
diff --git a/src/core/render_widget_host_view_qt_delegate_client.h b/src/core/render_widget_host_view_qt_delegate_client.h
index 4ba5da22..c56acfcf 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.h
+++ b/src/core/render_widget_host_view_qt_delegate_client.h
@@ -131,7 +131,6 @@ private:
RenderWidgetHostViewQt *m_rwhv;
// Mouse
- bool m_imeHasHiddenTextCapability;
uint m_mouseButtonPressed = 0;
QPoint m_previousMousePosition;
MultipleMouseClickHelper m_clickHelper;
diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp
index fff3eb70..c86888a2 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -93,18 +93,15 @@ void WebChannelTransport::Install(blink::WebLocalFrame *frame, uint worldId)
gin::Handle<WebChannelTransport> transport = gin::CreateHandle(isolate, new WebChannelTransport);
v8::Local<v8::Object> global = context->Global();
- v8::MaybeLocal<v8::Value> qtObjectValue = global->Get(context, gin::StringToV8(isolate, "qt"));
+ v8::Local<v8::Value> qtObjectValue;
v8::Local<v8::Object> qtObject;
- if (qtObjectValue.IsEmpty() || !qtObjectValue.ToLocalChecked()->IsObject()) {
+ if (!global->Get(context, gin::StringToV8(isolate, "qt")).ToLocal(&qtObjectValue) || !qtObjectValue->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);
+ global->Set(context, gin::StringToV8(isolate, "qt"), qtObject).Check();
} else {
- qtObject = v8::Local<v8::Object>::Cast(qtObjectValue.ToLocalChecked());
+ qtObject = v8::Local<v8::Object>::Cast(qtObjectValue);
}
- auto whocares = qtObject->Set(context, gin::StringToV8(isolate, "webChannelTransport"), transport.ToV8());
- Q_UNUSED(whocares);
+ qtObject->Set(context, gin::StringToV8(isolate, "webChannelTransport"), transport.ToV8()).Check();
}
void WebChannelTransport::Uninstall(blink::WebLocalFrame *frame, uint worldId)
@@ -119,13 +116,11 @@ void WebChannelTransport::Uninstall(blink::WebLocalFrame *frame, uint worldId)
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)
@@ -259,21 +254,21 @@ void WebChannelIPCTransport::DispatchWebChannelMessage(const std::vector<uint8_t
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 276167a6..f048a26d 100644
--- a/src/core/renderer/web_channel_ipc_transport.h
+++ b/src/core/renderer/web_channel_ipc_transport.h
@@ -64,8 +64,8 @@ private:
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);
diff --git a/src/core/tools/CMakeLists.txt b/src/core/tools/CMakeLists.txt
index 9d778bb0..5297bb50 100644
--- a/src/core/tools/CMakeLists.txt
+++ b/src/core/tools/CMakeLists.txt
@@ -11,8 +11,8 @@ if(QT_FEATURE_webengine_spellchecker)
TOOLS_TARGET WebEngineCore
SOURCES main.cpp
)
+ qt_internal_return_unless_building_tools()
qt_skip_warnings_are_errors(${dict_target_name})
- make_install_only(${dict_target_name})
add_dependencies(${dict_target_name} WebEngineCore)
qt_internal_extend_target(${dict_target_name} CONDITION WIN32
DEFINES WIN32_LEAN_AND_MEAN NOMINMAX
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 733283cc..0a83b248 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -438,15 +438,15 @@ QSharedPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavig
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_nextRequestId(1)
, m_currentDropAction(blink::kDragOperationNone)
, m_devToolsFrontend(nullptr)
{
@@ -454,20 +454,9 @@ WebContentsAdapter::WebContentsAdapter()
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::kDragOperationNone)
- , 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()
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index fffcfad8..2329d27e 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -132,8 +132,8 @@
#include <QMutex>
#include <QOffscreenSurface>
#if QT_CONFIG(opengl)
-# include <QOpenGLContext>
-# include <qopenglcontext_platform.h>
+#include <QOpenGLContext>
+#include <qopenglcontext_platform.h>
#endif
#include <QQuickWindow>
#include <QStringList>
@@ -170,7 +170,7 @@ static bool usingDefaultSGBackend()
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) {
@@ -246,7 +246,7 @@ static const char *getGLType(bool enableGLSoftwareRendering)
return glType;
}
#else
-static cont char *getGLType(bool enableGLSoftwareRendering)
+static const char *getGLType(bool enableGLSoftwareRendering)
{
return nullptr;
}
@@ -262,6 +262,7 @@ static void logContext(const char *glType, base::CommandLine *cmd)
{
QLoggingCategory webEngineContextLog("qt.webenginecontext");
if (webEngineContextLog.isInfoEnabled()) {
+#if QT_CONFIG(opengl)
const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format();
const auto profile = QMetaEnum::fromType<QSurfaceFormat::OpenGLContextProfile>().valueToKey(
sharedFormat.profile());
@@ -284,6 +285,9 @@ static void logContext(const char *glType, base::CommandLine *cmd)
glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(),
usingDefaultSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no",
usingANGLE() ? "yes" : "no", qPrintable(params.join(" ")));
+#else
+ qCInfo(webEngineContextLog) << "WebEngine compiled with no opengl enabled.";
+#endif //QT_CONFIG(opengl)
}
}
@@ -657,7 +661,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);
}
@@ -738,6 +741,7 @@ WebEngineContext::WebEngineContext()
const char *glType = getGLType(enableGLSoftwareRendering);
if (glType) {
+#if QT_CONFIG(opengl)
parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType);
parsedCommandLine->AppendSwitch(switches::kInProcessGPU);
if (enableGLSoftwareRendering) {
@@ -767,6 +771,7 @@ WebEngineContext::WebEngineContext()
if (!usingANGLE() || isGLES2Context)
parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext);
#endif
+#endif //QT_CONFIG(opengl)
} else {
parsedCommandLine->AppendSwitch(switches::kDisableGpu);
}
@@ -943,4 +948,16 @@ const char *qWebEngineChromiumVersion() noexcept
{
return CHROMIUM_VERSION;
}
+
+/*!
+ \relates <qtwebenginecoreglobal.h>
+ \since 6.3
+
+ Returns the version number of last Chromium version security patches have been
+ merged from.
+*/
+const char *qWebEngineChromiumSecurityPatchVersion() noexcept
+{
+ return "92.0.4515.166"; // FIXME: Remember to update
+}
QT_END_NAMESPACE
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index b82877ba..d7dceb30 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1542,7 +1542,13 @@ WebGestureEvent WebEventFactory::toWebGestureEvent(QNativeGestureEvent *ev)
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:
diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
index 9053d1e5..822fa8a2 100644
--- a/src/host/CMakeLists.txt
+++ b/src/host/CMakeLists.txt
@@ -36,3 +36,12 @@ if(QT_FEATURE_qtwebengine_build)
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()
+
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
new file mode 100644
index 00000000..9e4004ad
--- /dev/null
+++ b/src/pdf/CMakeLists.txt
@@ -0,0 +1,172 @@
+cmake_minimum_required(VERSION 3.19)
+find_package(Ninja 1.7.2 REQUIRED)
+find_package(Python2 2.7.5 REQUIRED)
+find_package(Nodejs 10.19 REQUIRED)
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+ create_pkg_config_host_wrapper(${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
+set(buildDir "${CMAKE_CURRENT_BINARY_DIR}")
+add_subdirectory(plugins/imageformats/pdf)
+
+##
+# PDF MODULE
+##
+
+qt_internal_add_module(Pdf
+ SOURCES
+ qpdfbookmarkmodel.cpp qpdfbookmarkmodel.h
+ qpdfdestination.cpp qpdfdestination.h qpdfdestination_p.h
+ qpdfdocument.cpp qpdfdocument.h qpdfdocument_p.h
+ qpdfdocumentrenderoptions.h
+ qpdflinkmodel.cpp qpdflinkmodel_p.h qpdflinkmodel_p_p.h
+ qpdfpagenavigation.cpp qpdfpagenavigation.h
+ qpdfpagerenderer.cpp qpdfpagerenderer.h
+ qpdfsearchmodel.cpp qpdfsearchmodel.h qpdfsearchmodel_p.h
+ qpdfsearchresult.cpp qpdfsearchresult.h qpdfsearchresult_p.h
+ qpdfselection.cpp qpdfselection.h qpdfselection_p.h
+ qtpdfglobal.h
+ qpdfnamespace.h
+ INCLUDE_DIRECTORIES
+ ../3rdparty/chromium
+ DEFINES
+ QT_BUILD_PDF_LIB
+ NOMINMAX
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::Network
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::Gui
+)
+
+##
+# PDF DOCS
+##
+
+qt_internal_add_docs(Pdf
+ doc/qtpdf.qdocconf
+)
+
+
+##
+# TOOLCHAIN SETUP
+##
+
+if(LINUX)
+ 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
+ )
+ 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"
+ enable_remoting=false
+ enable_resource_allowlist_generation=false
+ enable_web_speech=false
+ chrome_pgo_phase=0
+ )
+
+ if(LINUX)
+ list(APPEND gnArgArg
+ use_x11=false
+ is_cfi=false
+ ozone_auto_platforms=false
+ use_gnome_keyring=false)
+ endif()
+ if(MACOS)
+ list(APPEND gnArgArg angle_enable_vulkan=false)
+ endif()
+ if(WIN32)
+ list(APPEND gnArgArg
+ ninja_use_custom_environment_files=false
+ safe_browsing_mode=0
+ )
+ 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
+ )
+
+ 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
+##
+
+set(arch ${CMAKE_SYSTEM_PROCESSOR})
+target_include_directories(Pdf PRIVATE ${buildDir}/$<CONFIG>/${arch}/gen)
+add_gn_build_aritfacts_to_target(Pdf QtPdf pdf ${buildDir})
+add_dependencies(Pdf run_pdf_NinjaDone)
+
diff --git a/src/pdf/config/common.pri b/src/pdf/config/common.pri
deleted file mode 100644
index 7e5459a2..00000000
--- a/src/pdf/config/common.pri
+++ /dev/null
@@ -1,78 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/pdf/qtpdf-config.pri)
-QT_FOR_CONFIG += pdf-private
-
-gn_args += use_nss_certs=false
-
-qtConfig(webengine-qt-png) {
- gn_args += pdfium_use_qt_libpng=true
- gn_args += "pdfium_qt_libpng_includes=\"$$system_path($$QMAKE_INCDIR_LIBPNG)\""
-}
-
-#qtConfig(webengine-qt-jpeg) {
-# gn_args += use_qt_libjpeg=true
-# gn_args += "qt_libjpeg_includes=\"$$system_path($$QMAKE_INCDIR_LIBJPEG)\""
-#}
-
-qtConfig(webengine-qt-harfbuzz) {
- gn_args += use_qt_harfbuzz=true
- gn_args += "qt_harfbuzz_includes=\"$$system_path($$QMAKE_INCDIR_HARFBUZZ)\""
-}
-
-qtConfig(webengine-qt-freetype) {
- gn_args += use_qt_freetype=true
- gn_args += "qt_freetype_includes=\"$$system_path($$QMAKE_INCDIR_FREETYPE)\""
-}
-
-qtConfig(webengine-qt-zlib) {
- win32 {
- CONFIG(debug, debug|release) {
- qtzlib = Qt5Cored.lib
- } else {
- qtzlib = Qt5Core.lib
- }
-
- } else { qtzlib = libQt5Core.a
- }
- gn_args += use_qt_zlib = true
- gn_args += "qt_zlib_includes=\["\
- "\"$$system_path($$[QT_INSTALL_HEADERS])\"," \
- "\"$$system_path($$[QT_INSTALL_HEADERS]/QtCore)\"," \
- "\"$$system_path($$[QT_INSTALL_HEADERS]/QtZlib)\"\]"
- gn_args += "qt_zlib=\"$$system_path($$[QT_INSTALL_LIBS]/$$qtzlib)\""
-}
-
-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 {