File tree 4 files changed +41
-4
lines changed
4 files changed +41
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ macro(collect_optional_modules)
133
133
WebEngineQuick WebSockets HttpServer)
134
134
find_package (Qt${QT_MAJOR_VERSION} WebEngineQuick)
135
135
# for Windows and Linux, QtWebView depends on QtWebEngine to render content
136
- if (( WIN32 OR UNIX ) AND NOT APPLE AND Qt${QT_MAJOR_VERSION} WebEngineQuick_FOUND)
136
+ if ( Qt${QT_MAJOR_VERSION} WebEngineQuick_FOUND OR APPLE )
137
137
list (APPEND ALL_OPTIONAL_MODULES WebView)
138
138
endif ()
139
139
list (APPEND ALL_OPTIONAL_MODULES 3DCore 3DRender 3DInput 3DLogic 3DAnimation 3DExtras)
Original file line number Diff line number Diff line change 1
- # Copyright (C) 2023 The Qt Company Ltd.
2
- # SPDX-License-Identifier: BSD-3-Clause
1
+ # Copyright (C) 2024 The Qt Company Ltd.
2
+ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
+
4
+ PYSIDE_TEST(test_webview.py)
3
5
4
- # Tests to be added later
Original file line number Diff line number Diff line change
1
+ {
2
+ "files": ["test_webview.py"]
3
+ }
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2024 The Qt Company Ltd.
2
+ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
+ from __future__ import annotations
4
+
5
+ '''Unit test for WebView'''
6
+
7
+ import os
8
+ import sys
9
+ import unittest
10
+ from pathlib import Path
11
+
12
+ # Append the necessary paths to sys.path
13
+ sys .path .append (os .fspath (Path (__file__ ).resolve ().parents [1 ]))
14
+ from init_paths import init_test_paths
15
+ init_test_paths (False )
16
+
17
+ from PySide6 .QtWebView import QtWebView
18
+
19
+ from helper .usesqapplication import UsesQApplication
20
+
21
+
22
+ class QWebViewTestCase (UsesQApplication ):
23
+ def test_webview_exists (self ):
24
+ # Initialize QtWebView
25
+ QtWebView .initialize ()
26
+
27
+ # Check if QtWebView can be initialized
28
+ self .assertTrue (QtWebView is not None )
29
+ print ("QtWebView is available in PySide6." )
30
+
31
+
32
+ if __name__ == "__main__" :
33
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments