aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.pyside6_addons.md1
-rw-r--r--build_scripts/wheel_files.py6
-rw-r--r--coin/dependencies.yaml3
-rw-r--r--sources/pyside6/PySide6/QtWebView/CMakeLists.txt37
-rw-r--r--sources/pyside6/PySide6/QtWebView/typesystem_webview.xml10
-rw-r--r--sources/pyside6/cmake/PySideHelpers.cmake2
-rw-r--r--sources/pyside6/doc/extras/QtWebView.rst25
-rw-r--r--sources/pyside6/doc/modules.rst4
-rw-r--r--sources/pyside6/tests/QtWebView/CMakeLists.txt4
9 files changed, 90 insertions, 2 deletions
diff --git a/README.pyside6_addons.md b/README.pyside6_addons.md
index e6044c4a4..b0dc0596b 100644
--- a/README.pyside6_addons.md
+++ b/README.pyside6_addons.md
@@ -48,6 +48,7 @@ it includes the following Qt modules:
* QtHttpServer
* QtLocation
* QtAsyncio
+* QtWebView
### Documentation and Bugs
diff --git a/build_scripts/wheel_files.py b/build_scripts/wheel_files.py
index bd97f0941..3bf9590a4 100644
--- a/build_scripts/wheel_files.py
+++ b/build_scripts/wheel_files.py
@@ -224,6 +224,7 @@ def wheel_files_pyside_addons() -> list[ModuleData]:
module_QtHttpServer(),
module_QtLocation(),
module_QtAsyncio(),
+ module_QtWebView(),
]
return files
@@ -1044,3 +1045,8 @@ def module_QtAsyncio() -> ModuleData:
def module_QtExampleIcons() -> ModuleData:
data = ModuleData("ExampleIcons")
return data
+
+
+def module_QtWebView() -> ModuleData:
+ data = ModuleData("WebView")
+ return data
diff --git a/coin/dependencies.yaml b/coin/dependencies.yaml
index fda1681cd..ac83fdb27 100644
--- a/coin/dependencies.yaml
+++ b/coin/dependencies.yaml
@@ -36,5 +36,6 @@ dependencies: [
"../../qt/qtwayland",
"../../qt/qtwebchannel",
"../../qt/qtwebengine",
- "../../qt/qtwebsockets"
+ "../../qt/qtwebsockets",
+ "../../qt/qtwebview",
]
diff --git a/sources/pyside6/PySide6/QtWebView/CMakeLists.txt b/sources/pyside6/PySide6/QtWebView/CMakeLists.txt
new file mode 100644
index 000000000..974c3bf3b
--- /dev/null
+++ b/sources/pyside6/PySide6/QtWebView/CMakeLists.txt
@@ -0,0 +1,37 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+project(QtWebView)
+
+set(QtWebView_Src
+${QtWebView_GEN_DIR}/qtwebview_wrapper.cpp
+# module is always needed
+${QtWebView_GEN_DIR}/qtwebview_module_wrapper.cpp
+)
+
+set(QtWebView_include_dirs ${QtWebView_SOURCE_DIR}
+ ${QtWebView_BINARY_DIR}
+ ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}WebView_INCLUDE_DIRS}
+ ${libpyside_SOURCE_DIR}
+ ${QtGui_GEN_DIR}
+ ${QtCore_GEN_DIR}
+ ${QtWebView_GEN_DIR})
+
+set(QtWebView_libraries pyside6
+ ${Qt${QT_MAJOR_VERSION}WebView_LIBRARIES})
+
+set(QtWebView_deps QtGui)
+
+# for Windows and Linux, QtWebView depends on QtWebEngine to render content
+if (WIN32 OR UNIX)
+ list(APPEND QtWebView_deps QtWebEngineCore QtWebEngineQuick)
+endif()
+
+create_pyside_module(NAME QtWebView
+ INCLUDE_DIRS QtWebView_include_dirs
+ LIBRARIES QtWebView_libraries
+ DEPS QtWebView_deps
+ TYPESYSTEM_PATH QtWebView_SOURCE_DIR
+ SOURCES QtWebView_Src)
diff --git a/sources/pyside6/PySide6/QtWebView/typesystem_webview.xml b/sources/pyside6/PySide6/QtWebView/typesystem_webview.xml
new file mode 100644
index 000000000..1983ed811
--- /dev/null
+++ b/sources/pyside6/PySide6/QtWebView/typesystem_webview.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+-->
+<typesystem package="PySide6.QtWebView"
+ namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
+ <load-typesystem name="QtCore/typesystem_core.xml" generate ="no"/>
+ <namespace-type name="QtWebView"/>
+</typesystem>
diff --git a/sources/pyside6/cmake/PySideHelpers.cmake b/sources/pyside6/cmake/PySideHelpers.cmake
index 48502f384..8d565b651 100644
--- a/sources/pyside6/cmake/PySideHelpers.cmake
+++ b/sources/pyside6/cmake/PySideHelpers.cmake
@@ -129,7 +129,7 @@ macro(collect_optional_modules)
list(APPEND ALL_OPTIONAL_MODULES AxContainer)
endif()
list(APPEND ALL_OPTIONAL_MODULES WebChannel WebEngineCore WebEngineWidgets
- WebEngineQuick WebSockets HttpServer)
+ WebEngineQuick WebSockets HttpServer WebView)
list(APPEND ALL_OPTIONAL_MODULES 3DCore 3DRender 3DInput 3DLogic 3DAnimation 3DExtras)
endmacro()
diff --git a/sources/pyside6/doc/extras/QtWebView.rst b/sources/pyside6/doc/extras/QtWebView.rst
new file mode 100644
index 000000000..1b029ac0d
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtWebView.rst
@@ -0,0 +1,25 @@
+
+Qt WebView lets you display web content inside a QML application. To avoid including a full web
+browser stack, Qt WebView uses native APIs where appropriate.
+
+Getting Started
+^^^^^^^^^^^^^^^
+
+To include the definitions of modules classes, use the following
+directive:
+
+ ::
+
+ from PySide6.QtWebView import QtWebView
+
+To make the Qt WebView module function correctly across all platforms, it's
+necessary to call ``QtWebView.initialize()`` before creating the QGuiApplication
+instance and before window's QPlatformOpenGLContext is created. For usage,
+see the ``minibrowser`` example in the PySide6 examples package.
+
+API Reference
+^^^^^^^^^^^^^
+
+ * `Qt API <https://doc.qt.io/qt-6/qtwebview-index.html>`_
+
+The module also provides `QML types <https://doc.qt.io/qt-6/qtwebview-index.html#qml-api>`_
diff --git a/sources/pyside6/doc/modules.rst b/sources/pyside6/doc/modules.rst
index 8e77a4616..f108f5657 100644
--- a/sources/pyside6/doc/modules.rst
+++ b/sources/pyside6/doc/modules.rst
@@ -232,3 +232,7 @@ Qt Modules Supported by Qt for Python
.. grid-item-card:: :mod:`QtAsyncio <PySide6.QtAsyncio>`
Provides integration between asyncio and Qt's event loop.
+
+ .. grid-item-card:: :mod:`QtWebView <PySide6.QtWebView>`
+
+ Enables displaying web content in a QML application.
diff --git a/sources/pyside6/tests/QtWebView/CMakeLists.txt b/sources/pyside6/tests/QtWebView/CMakeLists.txt
new file mode 100644
index 000000000..63f313639
--- /dev/null
+++ b/sources/pyside6/tests/QtWebView/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Tests to be added later