File: QtWebKit.py

package info (click to toggle)
python-pyface 8.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,944 kB
  • sloc: python: 54,107; makefile: 82
file content (68 lines) | stat: -rw-r--r-- 2,155 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# (C) Copyright 2005-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
from . import qt_api

if qt_api == "pyqt5":
    from PyQt5.QtWidgets import *

    try:
        from PyQt5.QtWebEngine import *
        from PyQt5.QtWebEngineWidgets import (
            QWebEngineHistory as QWebHistory,
            QWebEngineHistoryItem as QWebHistoryItem,
            QWebEnginePage as QWebPage,
            QWebEngineView as QWebView,
            QWebEngineSettings as QWebSettings,
        )
    except ImportError:
        from PyQt5.QtWebKit import *
        from PyQt5.QtWebKitWidgets import *

elif qt_api == "pyqt6":
    from PyQt6.QtWidgets import *

    from PyQt6.QtWebEngineCore import (
        QWebEngineHistory as QWebHistory,
        QWebEngineHistoryItem as QWebHistoryItem,
        QWebEnginePage as QWebPage,
        QWebEngineSettings as QWebSettings,
    )
    from PyQt6.QtWebEngineWidgets import (
        QWebEngineView as QWebView,
    )

elif qt_api == "pyside6":
    from PySide6.QtWidgets import *

    from PySide6.QtWebEngineCore import (
        QWebEngineHistory as QWebHistory,
        QWebEngineSettings as QWebSettings,
        QWebEnginePage as QWebPage,
        QWebEngineHistoryItem as QWebHistoryItem,
    )
    from PySide6.QtWebEngineWidgets import (
        QWebEngineView as QWebView,
    )

else:
    from PySide2.QtWidgets import *

    # WebKit is currently in flux in PySide2
    try:
        from PySide2.QtWebEngineWidgets import (
            # QWebEngineHistory as QWebHistory,
            QWebEngineHistoryItem as QWebHistoryItem,
            QWebEnginePage as QWebPage,
            QWebEngineView as QWebView,
            QWebEngineSettings as QWebSettings,
        )
    except ImportError:
        from PySide2.QtWebKit import *
        from PySide2.QtWebKitWidgets import *