Skip to content

Commit

Permalink
Use QWebEngineView for Manual Panel
Browse files Browse the repository at this point in the history
The TaurusMainWindow "Manual" Panel uses the deprecated
QtWebkit.QWebView widget for displaying the manual, which
is not directly available from PyQt5 or PySide.

Replace it by its successor QtWebEngineWidgets.QWebEngineView

Closes taurus-org#1163
  • Loading branch information
Carlos Pascual committed Jul 22, 2021
1 parent 02fe071 commit af8b3b8
Showing 1 changed file with 3 additions and 17 deletions.
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 af8b3b8

Please sign in to comment.