Skip to content

Commit

Permalink
Merge branch 'webengine' into 'develop'
Browse files Browse the repository at this point in the history
Use QWebEngineView for Manual Panel

Closes taurus-org#1163

See merge request taurus-org/taurus!1209
  • Loading branch information
reszelaz committed Jul 23, 2021
2 parents 2fc2f43 + c67f5bf commit 5a11a89
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 17 deletions.
21 changes: 21 additions & 0 deletions lib/taurus/external/qt/QtWebEngine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
#
# Copyright © 2014-2015 Colin Duquesnoy
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)

"""
Provides QtWebEngine classes and functions.
"""

from . import PYQT5, PYSIDE2, PythonQtError


if PYQT5:
from PyQt5.QtWebEngine import * # noqa: F403,F401
elif PYSIDE2:
from PySide2.QtWebEngine import * # noqa: F403,F401
else:
raise PythonQtError("No Qt bindings could be found")
21 changes: 21 additions & 0 deletions lib/taurus/external/qt/QtWebEngineWidgets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
#
# Copyright © 2014-2015 Colin Duquesnoy
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)

"""
Provides QtWebEngineWidgets classes and functions.
"""

from . import PYQT5, PYSIDE2, PythonQtError


if PYQT5:
from PyQt5.QtWebEngineWidgets import * # noqa: F403,F401
elif PYSIDE2:
from PySide2.QtWebEngineWidgets import * # noqa: F403,F401
else:
raise PythonQtError("No Qt bindings could be found")
2 changes: 2 additions & 0 deletions lib/taurus/external/test/test_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def setUp(self):
"QtSvg",
"QtUiTools",
"QtWebKit",
"QtWebEngine",
"QtWebEngineWidgets",
"uic",
)

Expand Down
20 changes: 3 additions & 17 deletions lib/taurus/qt/qtgui/container/taurusmainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

from taurus import tauruscustomsettings, Release
from taurus.core.util.log import deprecation_decorator
from taurus.external.qt import Qt, compat
from taurus.external.qt import Qt, compat, QtWebEngineWidgets
from .taurusbasecontainer import TaurusBaseContainer

from taurus.qt.qtcore.configuration import BaseConfigurableClass
Expand Down Expand Up @@ -1114,22 +1114,8 @@ def getQtDesignerPluginInfo(cls):
def setHelpManualURI(self, uri):
self.__helpManualURI = uri
if self.helpManualBrowser is None:
try:
from taurus.external.qt.QtWebKit import QWebView

self.helpManualBrowser = QWebView()
except Exception:
self.helpManualBrowser = Qt.QLabel("QWebkit is not available")

def dummyload(*args):
pass

self.helpManualBrowser.load = dummyload
return
try:
url = Qt.QUrl.fromUserInput(uri)
except Exception:
url = Qt.QUrl(uri) # fallback for Qt<4.6
self.helpManualBrowser = QtWebEngineWidgets.QWebEngineView()
url = Qt.QUrl.fromUserInput(uri)
self.helpManualBrowser.load(url)

def getHelpManualURI(self):
Expand Down

0 comments on commit 5a11a89

Please sign in to comment.